2019-05-15 14:52:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Physical.h"
|
2019-05-29 16:06:33 +00:00
|
|
|
#include "Weapon.h"
|
2019-06-14 12:33:08 +00:00
|
|
|
#include "PedIK.h"
|
|
|
|
#include <animation\AnimBlendClumpData.h>
|
2019-05-29 16:06:33 +00:00
|
|
|
|
|
|
|
enum {
|
|
|
|
PED_MAX_WEAPONS = 13
|
|
|
|
};
|
2019-05-15 14:52:37 +00:00
|
|
|
|
2019-05-28 06:39:36 +00:00
|
|
|
enum PedState
|
2019-05-15 14:52:37 +00:00
|
|
|
{
|
2019-05-30 12:50:54 +00:00
|
|
|
PED_NONE,
|
2019-05-28 06:39:36 +00:00
|
|
|
PED_IDLE,
|
|
|
|
PED_LOOK_ENTITY,
|
|
|
|
PED_LOOK_HEADING,
|
|
|
|
PED_WANDER_RANGE,
|
|
|
|
PED_WANDER_PATH,
|
|
|
|
PED_SEEK_POS,
|
|
|
|
PED_SEEK_ENTITY,
|
|
|
|
PED_FLEE_POS,
|
|
|
|
PED_FLEE_ENTITY,
|
|
|
|
PED_PURSUE,
|
|
|
|
PED_FOLLOW_PATH,
|
|
|
|
PED_SNIPER_MODE,
|
|
|
|
PED_ROCKET_ODE,
|
|
|
|
PED_DUMMY,
|
|
|
|
PED_PAUSE,
|
|
|
|
PED_ATTACK,
|
|
|
|
PED_FIGHT,
|
|
|
|
PED_FACE_PHONE,
|
|
|
|
PED_MAKE_CALL,
|
|
|
|
PED_CHAT,
|
|
|
|
PED_MUG,
|
|
|
|
PED_AIM_GUN,
|
|
|
|
PED_AI_CONTROL,
|
|
|
|
PED_SEEK_CAR,
|
|
|
|
PED_SEEK_IN_BOAT,
|
|
|
|
PED_FOLLOW_ROUTE,
|
|
|
|
PED_CPR,
|
|
|
|
PED_SOLICIT,
|
|
|
|
PED_BUY_ICECREAM,
|
|
|
|
PED_INVESTIGATE,
|
|
|
|
PED_STEP_AWAY,
|
|
|
|
PED_ON_FIRE,
|
2019-05-30 12:50:54 +00:00
|
|
|
|
|
|
|
PED_UNKNOWN, // HANG_OUT in Fire_Head's idb
|
|
|
|
|
|
|
|
PED_STATES_NO_AI,
|
2019-05-28 06:39:36 +00:00
|
|
|
PED_JUMP,
|
|
|
|
PED_FALL,
|
|
|
|
PED_GETUP,
|
|
|
|
PED_STAGGER,
|
|
|
|
PED_DIVE_AWAY,
|
2019-05-30 12:50:54 +00:00
|
|
|
|
2019-05-28 06:39:36 +00:00
|
|
|
PED_STATES_NO_ST,
|
|
|
|
PED_ENTER_TRAIN,
|
|
|
|
PED_EXIT_TRAIN,
|
|
|
|
PED_ARREST_PLAYER,
|
|
|
|
PED_DRIVING,
|
|
|
|
PED_PASSENGER,
|
|
|
|
PED_TAXI_PASSENGER,
|
|
|
|
PED_OPEN_DOOR,
|
|
|
|
PED_DIE,
|
|
|
|
PED_DEAD,
|
|
|
|
PED_CARJACK,
|
|
|
|
PED_DRAG_FROM_CAR,
|
|
|
|
PED_ENTER_CAR,
|
|
|
|
PED_STEAL_CAR,
|
|
|
|
PED_EXIT_CAR,
|
|
|
|
PED_HANDS_UP,
|
|
|
|
PED_ARRESTED,
|
2019-05-15 14:52:37 +00:00
|
|
|
};
|
|
|
|
|
2019-05-29 16:06:33 +00:00
|
|
|
enum {
|
|
|
|
PEDMOVE_NONE,
|
|
|
|
PEDMOVE_STILL,
|
|
|
|
PEDMOVE_WALK,
|
|
|
|
PEDMOVE_RUN,
|
|
|
|
PEDMOVE_SPRINT,
|
|
|
|
};
|
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
class CVehicle;
|
|
|
|
|
|
|
|
class CPed : public CPhysical
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// 0x128
|
2019-05-19 19:28:10 +00:00
|
|
|
CStoredCollPoly m_collPoly;
|
|
|
|
float m_fCollisionSpeed;
|
|
|
|
uint8 m_ped_flagA1 : 1;
|
|
|
|
uint8 m_ped_flagA2 : 1;
|
|
|
|
uint8 m_ped_flagA4 : 1;
|
|
|
|
uint8 m_ped_flagA8 : 1;
|
|
|
|
uint8 m_ped_flagA10 : 1;
|
|
|
|
uint8 m_ped_flagA20 : 1;
|
|
|
|
uint8 m_ped_flagA40 : 1;
|
|
|
|
uint8 m_ped_flagA80 : 1;
|
|
|
|
uint8 m_ped_flagB1 : 1;
|
|
|
|
uint8 m_ped_flagB2 : 1;
|
|
|
|
uint8 m_ped_flagB4 : 1;
|
|
|
|
uint8 m_ped_flagB8 : 1;
|
|
|
|
uint8 m_ped_flagB10 : 1;
|
|
|
|
uint8 m_ped_flagB20 : 1;
|
|
|
|
uint8 m_ped_flagB40 : 1;
|
|
|
|
uint8 m_ped_flagB80 : 1;
|
|
|
|
uint8 m_ped_flagC1 : 1;
|
|
|
|
uint8 m_ped_flagC2 : 1;
|
|
|
|
uint8 m_ped_flagC4 : 1;
|
|
|
|
uint8 m_ped_flagC8 : 1;
|
|
|
|
uint8 m_ped_flagC10 : 1;
|
|
|
|
uint8 m_ped_flagC20 : 1;
|
|
|
|
uint8 m_ped_flagC40 : 1;
|
|
|
|
uint8 m_ped_flagC80 : 1;
|
|
|
|
uint8 m_ped_flagD1 : 1;
|
|
|
|
uint8 m_ped_flagD2 : 1;
|
|
|
|
uint8 m_ped_flagD4 : 1;
|
|
|
|
uint8 m_ped_flagD8 : 1;
|
|
|
|
uint8 m_ped_flagD10 : 1;
|
|
|
|
uint8 m_ped_flagD20 : 1;
|
|
|
|
uint8 m_ped_flagD40 : 1;
|
|
|
|
uint8 m_ped_flagD80 : 1;
|
|
|
|
uint8 m_ped_flagE1 : 1;
|
|
|
|
uint8 m_ped_flagE2 : 1;
|
|
|
|
uint8 m_ped_flagE4 : 1;
|
|
|
|
uint8 m_ped_flagE8 : 1;
|
|
|
|
uint8 m_ped_flagE10 : 1;
|
|
|
|
uint8 m_ped_flagE20 : 1;
|
|
|
|
uint8 m_ped_flagE40 : 1;
|
|
|
|
uint8 m_ped_flagE80 : 1;
|
|
|
|
uint8 m_ped_flagF1 : 1;
|
|
|
|
uint8 m_ped_flagF2 : 1;
|
|
|
|
uint8 m_ped_flagF4 : 1;
|
|
|
|
uint8 m_ped_flagF8 : 1;
|
|
|
|
uint8 m_ped_flagF10 : 1;
|
|
|
|
uint8 m_ped_flagF20 : 1;
|
|
|
|
uint8 m_ped_flagF40 : 1;
|
|
|
|
uint8 m_ped_flagF80 : 1;
|
|
|
|
uint8 m_ped_flagG1 : 1;
|
|
|
|
uint8 m_ped_flagG2 : 1;
|
|
|
|
uint8 m_ped_flagG4 : 1;
|
|
|
|
uint8 m_ped_flagG8 : 1;
|
|
|
|
uint8 m_ped_flagG10 : 1;
|
|
|
|
uint8 m_ped_flagG20 : 1;
|
|
|
|
uint8 m_ped_flagG40 : 1;
|
|
|
|
uint8 m_ped_flagG80 : 1;
|
|
|
|
uint8 m_ped_flagH1 : 1;
|
|
|
|
uint8 m_ped_flagH2 : 1;
|
|
|
|
uint8 m_ped_flagH4 : 1;
|
|
|
|
uint8 m_ped_flagH8 : 1;
|
|
|
|
uint8 m_ped_flagH10 : 1;
|
|
|
|
uint8 m_ped_flagH20 : 1;
|
|
|
|
uint8 m_ped_flagH40 : 1;
|
|
|
|
uint8 m_ped_flagH80 : 1;
|
|
|
|
uint8 m_ped_flagI1 : 1;
|
|
|
|
uint8 m_ped_flagI2 : 1;
|
|
|
|
uint8 m_ped_flagI4 : 1;
|
|
|
|
uint8 m_ped_flagI8 : 1;
|
|
|
|
uint8 m_ped_flagI10 : 1;
|
|
|
|
uint8 m_ped_flagI20 : 1;
|
|
|
|
uint8 m_ped_flagI40 : 1;
|
|
|
|
uint8 m_ped_flagI80 : 1;
|
2019-06-14 12:33:08 +00:00
|
|
|
uint8 stuff10[60];
|
|
|
|
int32 m_pEventEntity;
|
|
|
|
int32 m_fAngleToEvent;
|
2019-06-14 14:14:22 +00:00
|
|
|
AnimBlendFrameData *m_pFrames[PED_NODE_MAX];
|
2019-06-14 12:33:08 +00:00
|
|
|
int32 m_animGroup;
|
|
|
|
int32 m_pVehicleAnim;
|
|
|
|
CVector2D m_vecAnimMoveDelta;
|
|
|
|
CVector m_vecOffsetSeek;
|
|
|
|
CPedIK m_pedIK;
|
|
|
|
uint8 stuff1[12];
|
2019-05-15 14:52:37 +00:00
|
|
|
int32 m_nPedState;
|
2019-05-29 16:06:33 +00:00
|
|
|
int32 m_nLastPedState;
|
|
|
|
int32 m_nMoveState;
|
|
|
|
uint8 stuff2[188];
|
2019-05-15 14:52:37 +00:00
|
|
|
CEntity *m_pCurrentPhysSurface;
|
|
|
|
CVector m_vecOffsetFromPhysSurface;
|
|
|
|
CEntity *m_pCurSurface;
|
2019-06-14 12:33:08 +00:00
|
|
|
uint8 stuff3[12];
|
|
|
|
CPed* m_pSeekTarget;
|
2019-05-15 14:52:37 +00:00
|
|
|
CVehicle *m_pMyVehicle;
|
|
|
|
bool bInVehicle;
|
|
|
|
uint8 stuff4[23];
|
|
|
|
int32 m_nPedType;
|
2019-05-17 12:08:18 +00:00
|
|
|
|
|
|
|
uint8 stuff5[28];
|
2019-05-19 19:28:10 +00:00
|
|
|
CEntity *m_pCollidingEntity;
|
2019-05-29 16:06:33 +00:00
|
|
|
uint8 stuff6[12];
|
|
|
|
CWeapon m_weapons[PED_MAX_WEAPONS];
|
|
|
|
int32 stuff7;
|
|
|
|
uint8 m_currentWeapon;
|
2019-06-14 12:33:08 +00:00
|
|
|
uint8 stuff[3];
|
|
|
|
int32 m_pPointGunAt;
|
|
|
|
CVector m_vecHitLastPos;
|
|
|
|
uint8 stuff8[12];
|
|
|
|
CPed *m_pPedFight;
|
|
|
|
float m_fLookDirection;
|
|
|
|
int32 m_wepModelID;
|
|
|
|
uint8 stuff9[120];
|
2019-05-15 14:52:37 +00:00
|
|
|
|
2019-06-02 15:13:56 +00:00
|
|
|
static void *operator new(size_t);
|
|
|
|
static void operator delete(void*, size_t);
|
2019-05-19 19:28:10 +00:00
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
bool IsPlayer(void) { return m_nPedType == 0 || m_nPedType== 1 || m_nPedType == 2 || m_nPedType == 3; }
|
2019-05-28 06:39:36 +00:00
|
|
|
bool UseGroundColModel(void);
|
2019-06-14 12:33:08 +00:00
|
|
|
void AddWeaponModel(int id);
|
|
|
|
void AimGun();
|
2019-05-19 19:28:10 +00:00
|
|
|
void KillPedWithCar(CVehicle *veh, float impulse);
|
2019-06-14 12:33:08 +00:00
|
|
|
void Say(uint16 audio);
|
|
|
|
void SetLookFlag(CEntity *to, bool set);
|
2019-05-29 16:06:33 +00:00
|
|
|
CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; }
|
2019-06-13 00:35:26 +00:00
|
|
|
|
|
|
|
static Bool &bNastyLimbsCheat;
|
|
|
|
static Bool &bPedCheat2;
|
|
|
|
static Bool &bPedCheat3;
|
2019-05-15 14:52:37 +00:00
|
|
|
};
|
|
|
|
static_assert(offsetof(CPed, m_nPedState) == 0x224, "CPed: error");
|
|
|
|
static_assert(offsetof(CPed, m_pCurSurface) == 0x2FC, "CPed: error");
|
|
|
|
static_assert(offsetof(CPed, m_pMyVehicle) == 0x310, "CPed: error");
|
|
|
|
static_assert(offsetof(CPed, m_nPedType) == 0x32C, "CPed: error");
|
2019-05-19 19:28:10 +00:00
|
|
|
static_assert(offsetof(CPed, m_pCollidingEntity) == 0x34C, "CPed: error");
|
2019-05-29 16:06:33 +00:00
|
|
|
static_assert(offsetof(CPed, m_weapons) == 0x35C, "CPed: error");
|
|
|
|
static_assert(offsetof(CPed, m_currentWeapon) == 0x498, "CPed: error");
|
2019-06-14 12:33:08 +00:00
|
|
|
static_assert(sizeof(CPed) == 0x53C, "CPed: error");
|