2019-06-17 08:30:02 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-06-19 12:06:13 +00:00
|
|
|
// Index into the PedType array
|
2020-02-16 02:15:58 +00:00
|
|
|
enum ePedType
|
2019-06-19 12:06:13 +00:00
|
|
|
{
|
|
|
|
PEDTYPE_PLAYER1,
|
|
|
|
PEDTYPE_PLAYER2,
|
|
|
|
PEDTYPE_PLAYER3,
|
|
|
|
PEDTYPE_PLAYER4,
|
|
|
|
PEDTYPE_CIVMALE,
|
|
|
|
PEDTYPE_CIVFEMALE,
|
|
|
|
PEDTYPE_COP,
|
|
|
|
PEDTYPE_GANG1,
|
|
|
|
PEDTYPE_GANG2,
|
|
|
|
PEDTYPE_GANG3,
|
|
|
|
PEDTYPE_GANG4,
|
2020-09-26 23:36:49 +00:00
|
|
|
PEDTYPE_GANG5, // Security - hardcoded
|
2019-06-19 12:06:13 +00:00
|
|
|
PEDTYPE_GANG6,
|
2020-09-26 23:36:49 +00:00
|
|
|
PEDTYPE_GANG7, // Vercetti gang - hardcoded
|
2019-06-19 12:06:13 +00:00
|
|
|
PEDTYPE_GANG8,
|
|
|
|
PEDTYPE_GANG9,
|
|
|
|
PEDTYPE_EMERGENCY,
|
|
|
|
PEDTYPE_FIREMAN,
|
|
|
|
PEDTYPE_CRIMINAL,
|
|
|
|
PEDTYPE_UNUSED1,
|
2019-06-26 09:12:00 +00:00
|
|
|
PEDTYPE_PROSTITUTE,
|
|
|
|
PEDTYPE_SPECIAL,
|
2019-06-19 12:06:13 +00:00
|
|
|
PEDTYPE_UNUSED2,
|
|
|
|
|
|
|
|
NUM_PEDTYPES
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PED_FLAG_PLAYER1 = 1 << 0,
|
|
|
|
PED_FLAG_PLAYER2 = 1 << 1,
|
|
|
|
PED_FLAG_PLAYER3 = 1 << 2,
|
|
|
|
PED_FLAG_PLAYER4 = 1 << 3,
|
|
|
|
PED_FLAG_CIVMALE = 1 << 4,
|
|
|
|
PED_FLAG_CIVFEMALE = 1 << 5,
|
|
|
|
PED_FLAG_COP = 1 << 6,
|
|
|
|
PED_FLAG_GANG1 = 1 << 7,
|
|
|
|
PED_FLAG_GANG2 = 1 << 8,
|
|
|
|
PED_FLAG_GANG3 = 1 << 9,
|
|
|
|
PED_FLAG_GANG4 = 1 << 10,
|
|
|
|
PED_FLAG_GANG5 = 1 << 11,
|
|
|
|
PED_FLAG_GANG6 = 1 << 12,
|
|
|
|
PED_FLAG_GANG7 = 1 << 13,
|
|
|
|
PED_FLAG_GANG8 = 1 << 14,
|
|
|
|
PED_FLAG_GANG9 = 1 << 15,
|
|
|
|
PED_FLAG_EMERGENCY = 1 << 16,
|
|
|
|
PED_FLAG_PROSTITUTE = 1 << 17,
|
|
|
|
PED_FLAG_CRIMINAL = 1 << 18,
|
|
|
|
PED_FLAG_SPECIAL = 1 << 19,
|
|
|
|
PED_FLAG_GUN = 1 << 20,
|
2019-06-19 13:22:42 +00:00
|
|
|
PED_FLAG_COP_CAR = 1 << 21,
|
|
|
|
PED_FLAG_FAST_CAR = 1 << 22,
|
2019-06-19 12:06:13 +00:00
|
|
|
PED_FLAG_EXPLOSION = 1 << 23,
|
|
|
|
PED_FLAG_FIREMAN = 1 << 24,
|
|
|
|
PED_FLAG_DEADPEDS = 1 << 25,
|
|
|
|
};
|
|
|
|
|
|
|
|
class CPedType
|
|
|
|
{
|
|
|
|
uint32 m_flag;
|
2019-06-19 13:22:42 +00:00
|
|
|
float unknown1;
|
|
|
|
float unknown2;
|
|
|
|
float unknown3;
|
|
|
|
float unknown4;
|
|
|
|
float unknown5;
|
2019-06-19 12:06:13 +00:00
|
|
|
uint32 m_threats;
|
|
|
|
uint32 m_avoid;
|
|
|
|
|
2020-04-17 04:01:54 +00:00
|
|
|
static CPedType *ms_apPedType[NUM_PEDTYPES];
|
2019-06-19 12:06:13 +00:00
|
|
|
public:
|
2019-06-18 12:55:39 +00:00
|
|
|
|
2019-06-19 12:06:13 +00:00
|
|
|
static void Initialise(void);
|
2019-06-19 13:22:42 +00:00
|
|
|
static void Shutdown(void);
|
2019-06-19 12:06:13 +00:00
|
|
|
static void LoadPedData(void);
|
2020-02-16 02:15:58 +00:00
|
|
|
static ePedType FindPedType(char *type);
|
2019-06-19 13:22:42 +00:00
|
|
|
static uint32 FindPedFlag(char *type);
|
2019-10-08 20:07:11 +00:00
|
|
|
static void Save(uint8 *buf, uint32 *size);
|
|
|
|
static void Load(uint8 *buf, uint32 size);
|
2019-06-18 12:55:39 +00:00
|
|
|
|
2019-06-19 12:06:13 +00:00
|
|
|
static uint32 GetFlag(int type) { return ms_apPedType[type]->m_flag; }
|
|
|
|
static uint32 GetAvoid(int type) { return ms_apPedType[type]->m_avoid; }
|
|
|
|
static uint32 GetThreats(int type) { return ms_apPedType[type]->m_threats; }
|
2020-04-08 21:16:29 +00:00
|
|
|
static void SetThreats(int type, uint32 threat) { ms_apPedType[type]->m_threats = threat; }
|
2020-02-16 20:08:54 +00:00
|
|
|
static void AddThreat(int type, int threat) { ms_apPedType[type]->m_threats |= threat; }
|
|
|
|
static void RemoveThreat(int type, int threat) { ms_apPedType[type]->m_threats &= ~threat; }
|
|
|
|
static bool IsThreat(int type, int threat) { return ms_apPedType[type]->m_threats & threat; }
|
2019-06-17 08:30:02 +00:00
|
|
|
};
|
2019-06-18 12:55:39 +00:00
|
|
|
|
2020-05-10 15:49:33 +00:00
|
|
|
VALIDATE_SIZE(CPedType, 0x20);
|
2020-11-19 23:18:37 +00:00
|
|
|
|
|
|
|
enum ePedStats
|
|
|
|
{
|
2021-01-08 00:41:40 +00:00
|
|
|
PEDSTAT_COWARD,
|
|
|
|
PEDSTAT_SHOPPER,
|
|
|
|
PEDSTAT_OLDSHOPPER,
|
2020-11-19 23:18:37 +00:00
|
|
|
PEDSTAT_PLAYER,
|
|
|
|
PEDSTAT_COP,
|
|
|
|
PEDSTAT_MEDIC,
|
|
|
|
PEDSTAT_FIREMAN,
|
|
|
|
PEDSTAT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D = 2,
|
|
|
|
STAT_CAN_KICK = 4,
|
|
|
|
STAT_CAN_ROUNDHOUSE = 8,
|
|
|
|
STAT_NO_DIVE = 0x10,
|
|
|
|
STAT_ONE_HIT_KNOCKDOWN = 0x20,
|
|
|
|
STAT_SHOPPING_BAGS = 0x40,
|
|
|
|
STAT_GUN_PANIC = 0x80
|
|
|
|
};
|
|
|
|
|
|
|
|
class CPedStats
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ePedStats m_type;
|
|
|
|
char m_name[24];
|
|
|
|
float m_fleeDistance;
|
|
|
|
float m_headingChangeRate;
|
|
|
|
int8 m_fear;
|
|
|
|
int8 m_temper;
|
|
|
|
int8 m_lawfulness;
|
|
|
|
int8 m_sexiness;
|
|
|
|
float m_attackStrength;
|
|
|
|
float m_defendWeakness;
|
|
|
|
int16 m_flags;
|
|
|
|
|
|
|
|
static CPedStats *ms_apPedStats[NUM_PEDSTATS];
|
|
|
|
|
|
|
|
static void Initialise(void);
|
|
|
|
static void Shutdown(void);
|
|
|
|
static void LoadPedStats(void);
|
|
|
|
static ePedStats GetPedStatType(char *name);
|
|
|
|
};
|
|
|
|
|
|
|
|
VALIDATE_SIZE(CPedStats, 0x34);
|