2019-06-30 10:59:55 +00:00
|
|
|
#include "common.h"
|
|
|
|
#include "patcher.h"
|
|
|
|
#include "CopPed.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "ModelIndices.h"
|
|
|
|
|
|
|
|
CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP)
|
|
|
|
{
|
|
|
|
m_nCopType = copType;
|
|
|
|
switch (copType) {
|
|
|
|
case COP_STREET:
|
|
|
|
SetModelIndex(MI_COP);
|
|
|
|
GiveWeapon(WEAPONTYPE_COLT45, 1000);
|
|
|
|
m_currentWeapon = WEAPONTYPE_UNARMED;
|
|
|
|
m_fArmour = 0.0f;
|
|
|
|
m_wepSkills = 208; /* TODO: what is this? seems unused */
|
|
|
|
m_wepAccuracy = 60;
|
|
|
|
break;
|
|
|
|
case COP_FBI:
|
|
|
|
SetModelIndex(MI_FBI);
|
|
|
|
GiveWeapon(WEAPONTYPE_COLT45, 1000);
|
|
|
|
GiveWeapon(WEAPONTYPE_AK47, 1000);
|
|
|
|
SetCurrentWeapon(WEAPONTYPE_AK47);
|
|
|
|
m_fArmour = 100.0f;
|
|
|
|
m_wepSkills = 176; /* TODO: what is this? seems unused */
|
|
|
|
m_wepAccuracy = 76;
|
|
|
|
break;
|
|
|
|
case COP_SWAT:
|
|
|
|
SetModelIndex(MI_SWAT);
|
|
|
|
GiveWeapon(WEAPONTYPE_COLT45, 1000);
|
|
|
|
GiveWeapon(WEAPONTYPE_UZI, 1000);
|
|
|
|
SetCurrentWeapon(WEAPONTYPE_UZI);
|
|
|
|
m_fArmour = 50.0f;
|
|
|
|
m_wepSkills = 32; /* TODO: what is this? seems unused */
|
|
|
|
m_wepAccuracy = 64;
|
|
|
|
break;
|
|
|
|
case COP_ARMY:
|
|
|
|
SetModelIndex(MI_ARMY);
|
|
|
|
GiveWeapon(WEAPONTYPE_COLT45, 1000);
|
|
|
|
GiveWeapon(WEAPONTYPE_M16, 1000);
|
|
|
|
GiveWeapon(WEAPONTYPE_GRENADE, 10);
|
|
|
|
SetCurrentWeapon(WEAPONTYPE_M16);
|
|
|
|
m_fArmour = 100.0f;
|
|
|
|
m_wepSkills = 32; /* TODO: what is this? seems unused */
|
|
|
|
m_wepAccuracy = 84;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
m_bIsInPursuit = false;
|
|
|
|
field_1350 = 1;
|
|
|
|
m_bIsDisabledCop = false;
|
|
|
|
field_1356 = 0;
|
|
|
|
m_attackTimer = 0;
|
|
|
|
field_1351 = 0;
|
|
|
|
m_bZoneDisabledButClose = false;
|
|
|
|
m_bZoneDisabled = false;
|
|
|
|
field_1364 = -1;
|
|
|
|
m_pPointGunAt = nil;
|
|
|
|
}
|
2019-06-30 10:59:55 +00:00
|
|
|
|
|
|
|
CCopPed::~CCopPed()
|
|
|
|
{
|
|
|
|
ClearPursuit();
|
|
|
|
}
|
|
|
|
|
|
|
|
WRAPPER void CCopPed::ClearPursuit(void) { EAXJMP(0x4C28C0); }
|
|
|
|
|
2019-07-08 06:46:42 +00:00
|
|
|
class CCopPed_ : public CCopPed
|
|
|
|
{
|
|
|
|
public:
|
2019-07-14 09:49:03 +00:00
|
|
|
CCopPed *ctor(eCopType type) { return ::new (this) CCopPed(type); };
|
2019-07-08 06:46:42 +00:00
|
|
|
void dtor(void) { CCopPed::~CCopPed(); }
|
|
|
|
};
|
|
|
|
|
2019-06-30 10:59:55 +00:00
|
|
|
STARTPATCHES
|
2019-07-14 09:49:03 +00:00
|
|
|
InjectHook(0x4C11B0, &CCopPed_::ctor, PATCH_JUMP);
|
2019-07-08 06:46:42 +00:00
|
|
|
InjectHook(0x4C13E0, &CCopPed_::dtor, PATCH_JUMP);
|
|
|
|
ENDPATCHES
|