Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Darkel/Wanted update.
  • Loading branch information
gennariarmando committed Jul 4, 2019
1 parent bdd5ed6 commit 9fed0c040c482bac8cba688e7564c8e8dfe23b30
@@ -136,6 +136,15 @@ CCamera::RenderMotionBlur(void)
m_motionBlur, m_BlurType, m_imotionBlurAddAlpha); m_motionBlur, m_BlurType, m_imotionBlurAddAlpha);
} }


void
CCamera::ClearPlayerWeaponMode()
{
PlayerWeaponMode.Mode = 0;
PlayerWeaponMode.MaxZoom = 1;
PlayerWeaponMode.MinZoom = -1;
PlayerWeaponMode.Duration = 0.0f;
}



/* /*
* *
@@ -457,6 +457,7 @@ int m_iModeObbeCamIsInForCar;
void SetMotionBlur(int r, int g, int b, int a, int type); void SetMotionBlur(int r, int g, int b, int a, int type);
void SetMotionBlurAlpha(int a); void SetMotionBlurAlpha(int a);
void RenderMotionBlur(void); void RenderMotionBlur(void);
void ClearPlayerWeaponMode();
void CalculateDerivedValues(void); void CalculateDerivedValues(void);


void DrawBordersForWideScreen(void); void DrawBordersForWideScreen(void);
@@ -2,4 +2,11 @@
#include "Stats.h" #include "Stats.h"


int32 &CStats::DaysPassed = *(int32*)0x8F2BB8; int32 &CStats::DaysPassed = *(int32*)0x8F2BB8;
int32 &CStats::HeadShots = *(int32*)0x8F647C; int32 &CStats::HeadShots = *(int32*)0x8F647C;
int32 &CStats::NumberKillFrenziesPassed = *(int32*)0x8E287C;
int32 &CStats::PeopleKilledByOthers = *(int32*)0x8E2C50;

void CStats::AnotherKillFrenzyPassed()
{
++NumberKillFrenziesPassed;
}
@@ -5,4 +5,8 @@ class CStats
public: public:
static int32 &DaysPassed; static int32 &DaysPassed;
static int32 &HeadShots; static int32 &HeadShots;
static int32 &NumberKillFrenziesPassed;
static int32 &PeopleKilledByOthers;

static void AnotherKillFrenzyPassed();
}; };
@@ -2,6 +2,8 @@
#include "patcher.h" #include "patcher.h"
#include "Wanted.h" #include "Wanted.h"


int32 &CWanted::MaximumWantedLevel = *(int32*)0x5F7714;

bool CWanted::AreSwatRequired() bool CWanted::AreSwatRequired()
{ {
return m_nWantedLevel >= 4; return m_nWantedLevel >= 4;
@@ -33,4 +35,95 @@ int CWanted::NumOfHelisRequired()
default: default:
return 0; return 0;
}; };
}

void CWanted::SetWantedLevel(int32 level)
{
ClearQdCrimes();
switch (level) {
case NOTWANTED:
m_nChaos = 0;
break;
case WANTEDLEVEL_1:
m_nChaos = 60;
break;
case WANTEDLEVEL_2:
m_nChaos = 220;
break;
case WANTEDLEVEL_3:
m_nChaos = 420;
break;
case WANTEDLEVEL_4:
m_nChaos = 820;
break;
case WANTEDLEVEL_5:
m_nChaos = 1620;
break;
case WANTEDLEVEL_6:
m_nChaos = 3220;
break;
default:
if (level > MaximumWantedLevel)
m_nChaos = MaximumWantedLevel;
break;
}
UpdateWantedLevel();
}

void CWanted::ClearQdCrimes()
{
for (int i = 0; i < 16; i++) {
m_sCrimes[i].m_eCrimeType = CRIME_NONE;
};
}

void CWanted::UpdateWantedLevel()
{
int32 CurrWantedLevel = m_nWantedLevel;

if (m_nChaos >= 0 && m_nChaos < 40) {
m_nWantedLevel = NOTWANTED;
m_MaximumLawEnforcerVehicles = 0;
m_MaxCops = 0;
m_RoadblockDensity = 0;
}
else if (m_nChaos >= 40 && m_nChaos < 200) {
m_nWantedLevel = WANTEDLEVEL_1;
m_MaximumLawEnforcerVehicles = 1;
m_MaxCops = 1;
m_RoadblockDensity = 0;
}
else if (m_nChaos >= 200 && m_nChaos < 400) {
m_nWantedLevel = WANTEDLEVEL_2;
m_MaximumLawEnforcerVehicles = 2;
m_MaxCops = 3;
m_RoadblockDensity = 0;
}
else if (m_nChaos >= 400 && m_nChaos < 800) {
m_nWantedLevel = WANTEDLEVEL_3;
m_MaximumLawEnforcerVehicles = 2;
m_MaxCops = 4;
m_RoadblockDensity = 4;
}
else if (m_nChaos >= 800 && m_nChaos < 1600) {
m_nWantedLevel = WANTEDLEVEL_4;
m_MaximumLawEnforcerVehicles = 2;
m_MaxCops = 6;
m_RoadblockDensity = 8;
}
else if (m_nChaos >= 1600 && m_nChaos < 3200) {
m_nWantedLevel = WANTEDLEVEL_5;
m_MaximumLawEnforcerVehicles = 3;
m_MaxCops = 8;
m_RoadblockDensity = 10;
}
else if (m_nChaos >= 3200) {
m_nWantedLevel = WANTEDLEVEL_6;
m_MaximumLawEnforcerVehicles = 3;
m_MaxCops = 10;
m_RoadblockDensity = 12;
}

if (CurrWantedLevel != m_nWantedLevel)
m_nLastWantedLevelChange = CTimer::GetTimeInMilliseconds();
} }
@@ -20,11 +20,11 @@ class CWanted
int32 m_nLastUpdateTime; int32 m_nLastUpdateTime;
int32 m_nLastWantedLevelChange; int32 m_nLastWantedLevelChange;
float m_fCrimeSensitivity; float m_fCrimeSensitivity;
uint8 m_bCurrentCops; uint8 m_CurrentCops;
uint8 m_bMaxCops; uint8 m_MaxCops;
uint8 m_bMaximumLawEnforcerVehicles; uint8 m_MaximumLawEnforcerVehicles;
int8 field_19; int8 field_19;
int16 m_wRoadblockDensity; int16 m_RoadblockDensity;
uint8 m_IsIgnoredByCops : 1; uint8 m_IsIgnoredByCops : 1;
uint8 m_IsIgnoredByEveryOne : 1; uint8 m_IsIgnoredByEveryOne : 1;
uint8 m_IsSwatRequired : 1; uint8 m_IsSwatRequired : 1;
@@ -34,12 +34,16 @@ class CWanted
int32 m_nWantedLevel; int32 m_nWantedLevel;
CCrime m_sCrimes[16]; CCrime m_sCrimes[16];
CCopPed *m_pCops[10]; CCopPed *m_pCops[10];
static int32 &MaximumWantedLevel;


public: public:
bool AreSwatRequired(); bool AreSwatRequired();
bool AreFbiRequired(); bool AreFbiRequired();
bool AreArmyRequired(); bool AreArmyRequired();
int NumOfHelisRequired(); int NumOfHelisRequired();
void SetWantedLevel(int32);
void ClearQdCrimes();
void UpdateWantedLevel();
}; };


static_assert(sizeof(CWanted) == 0x204, "CWanted: error"); static_assert(sizeof(CWanted) == 0x204, "CWanted: error");

0 comments on commit 9fed0c0

Please sign in to comment.