summaryrefslogtreecommitdiff
path: root/src/peds/Population.h
blob: ae4aa44cf957ff5e29f64abc5c10188903d4ea88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#pragma once

#include "Game.h"
#include "PedType.h"

class CPed;
class CVehicle;
class CDummyObject;
class CObject;

struct PedGroup
{
	int32 models[NUMMODELSPERPEDGROUP];
};

// Don't know the original name
struct RegenerationPoint
{
	eLevelName srcLevel; // this and below one may need to be exchanged
	eLevelName destLevel;
	float x1;
	float x2;
	float y1;
	float y2;
	float z1;
	float z2;
	CVector destPosA;
	CVector destPosB;
	CVector srcPosA;
	CVector srcPosB;
};

class CPopulation
{
public:
	static PedGroup ms_pPedGroups[NUMPEDGROUPS];
	static bool ms_bGivePedsWeapons;
	static int32 m_AllRandomPedsThisType;
	static float PedDensityMultiplier;
	static uint32 ms_nTotalMissionPeds;
	static int32 MaxNumberOfPedsInUse;
	static uint32 ms_nNumCivMale;
	static uint32 ms_nNumCivFemale;
	static uint32 ms_nNumCop;
	static bool bZoneChangeHasHappened;
	static uint32 ms_nNumEmergency;
	static int8 m_CountDownToPedsAtStart;
	static uint32 ms_nNumGang1;
	static uint32 ms_nNumGang2;
	static uint32 ms_nTotalPeds;
	static uint32 ms_nNumGang3;
	static uint32 ms_nTotalGangPeds;
	static uint32 ms_nNumGang4;
	static uint32 ms_nTotalCivPeds;
	static uint32 ms_nNumGang5;
	static uint32 ms_nNumDummy;
	static uint32 ms_nNumGang6;
	static uint32 ms_nNumGang9;
	static uint32 ms_nNumGang7;
	static uint32 ms_nNumGang8;
	static CVector RegenerationPoint_a;
	static CVector RegenerationPoint_b;
	static CVector RegenerationForward;

	static uint32 ms_nTotalCarPassengerPeds;
	static uint32 NumMiamiViceCops;

	static void Initialise();
	static void Update(void);
	static void LoadPedGroups();
	static void UpdatePedCount(ePedType, bool);
	static void DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool);
	static CPed *AddPedInCar(CVehicle *car, bool isDriver);
	static bool IsPointInSafeZone(CVector *coors);
	static void RemovePed(CPed *ent);
	static int32 ChooseCivilianOccupation(int32);
	static int32 ChoosePolicePedOccupation();
	static int32 ChooseGangOccupation(int);
	static void FindCollisionZoneForCoors(CVector*, int*, eLevelName*);
	static void FindClosestZoneForCoors(CVector*, int*, eLevelName, eLevelName);
	static void GeneratePedsAtStartOfGame();
	static float PedCreationDistMultiplier();
	static CPed *AddPed(ePedType pedType, uint32 mi, CVector const &coors, int32 modifier = 0);
	static void AddToPopulation(float, float, float, float);
	static void ManagePopulation(void);
	static void MoveCarsAndPedsOutOfAbandonedZones(void);
	static void ConvertToRealObject(CDummyObject*);
	static void ConvertToDummyObject(CObject*);
	static void ConvertAllObjectsToDummyObjects(void);
	static bool TestRoomForDummyObject(CObject*);
	static bool TestSafeForRealObject(CDummyObject*);

	static CPed* AddDeadPedInFrontOfCar(const CVector& pos, CVehicle* pCulprit);
};