CWanted, anim fix, ped objs renaming, remove III beta features

This commit is contained in:
eray orçunus
2020-06-22 04:02:44 +03:00
parent d6a853bd60
commit f3ed6659c3
29 changed files with 358 additions and 394 deletions

View File

@ -5071,7 +5071,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
// This is not working on cars as SA
// Because III/VC doesn't have any buttons tied to LeftStick if you're not in Classic Configuration, using Dodo or using GInput/Pad, so :shrug:
if (Abs(pad->GetSteeringUpDown()) > 120.0f) {
if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE) {
if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_CAR) {
yMovement += Abs(pad->GetSteeringUpDown()) * (FOV / 80.0f * 3.f / 70.f) * pad->GetSteeringUpDown() * 0.007f * 0.007f * 0.5;
}
}

View File

@ -18,6 +18,9 @@ enum eCrimeType {
CRIME_COP_BURNED,
CRIME_VEHICLE_BURNED,
CRIME_DESTROYED_CESSNA,
CRIME_EXPLOSION,
CRIME_HIT_PED_NASTYWEAPON,
CRIME_HIT_COP_NASTYWEAPON,
NUM_CRIME_TYPES
};

View File

@ -187,6 +187,7 @@ CEventList::FindClosestEvent(eEventType type, CVector posn, int32 *event)
return found;
}
// --MIAMI: Done
void
CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCare)
{
@ -201,19 +202,31 @@ CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCar
case EVENT_HIT_AND_RUN_COP: crime = CRIME_RUNOVER_COP; break;
case EVENT_SHOOT_PED: crime = CRIME_SHOOT_PED; break;
case EVENT_SHOOT_COP: crime = CRIME_SHOOT_COP; break;
case EVENT_EXPLOSION: crime = CRIME_EXPLOSION; break;
case EVENT_PED_SET_ON_FIRE: crime = CRIME_PED_BURNED; break;
case EVENT_COP_SET_ON_FIRE: crime = CRIME_COP_BURNED; break;
case EVENT_CAR_SET_ON_FIRE: crime = CRIME_VEHICLE_BURNED; break;
case EVENT_ASSAULT_NASTYWEAPON: crime = CRIME_HIT_PED_NASTYWEAPON; break;
case EVENT_ASSAULT_NASTYWEAPON_POLICE: crime = CRIME_HIT_COP_NASTYWEAPON; break;
default: crime = CRIME_NONE; break;
}
if (crime == CRIME_HIT_PED && IsPedPointerValid((CPed*)crimeId) && FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 && ((CPed*)crimeId)->bBeingChasedByPolice) {
if (!((CPed*)crimeId)->DyingOrDead()) {
CMessages::AddBigMessage(TheText.Get("GOODBOY"), 5000, 0);
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 50;
}
return;
}
if(crime == CRIME_NONE)
return;
CVector playerPedCoors = FindPlayerPed()->GetPosition();
CVector playerCoors = FindPlayerCoors();
if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0){
if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0 ||
CGame::germanGame && (crime == CRIME_SHOOT_PED || crime == CRIME_SHOOT_COP || crime == CRIME_COP_BURNED || crime == CRIME_VEHICLE_BURNED)){
FindPlayerPed()->m_pWanted->RegisterCrime_Immediately(crime, playerPedCoors, crimeId, copsDontCare);
FindPlayerPed()->m_pWanted->SetWantedLevelNoDrop(1);
}else
@ -221,7 +234,7 @@ CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCar
if(type == EVENT_ASSAULT_POLICE)
FindPlayerPed()->SetWantedLevelNoDrop(1);
if(type == EVENT_SHOOT_COP)
if(type == EVENT_SHOOT_COP || type == EVENT_ASSAULT_NASTYWEAPON_POLICE)
FindPlayerPed()->SetWantedLevelNoDrop(2);
}

View File

@ -315,13 +315,13 @@ void ArmourCheat()
void WantedLevelUpCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT5"), true);
FindPlayerPed()->SetWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6));
FindPlayerPed()->m_pWanted->CheatWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6));
}
void WantedLevelDownCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT5"), true);
FindPlayerPed()->SetWantedLevel(0);
FindPlayerPed()->m_pWanted->CheatWantedLevel(0);
}
void SunnyWeatherCheat()

View File

@ -416,7 +416,7 @@ CPlayerInfo::Process(void)
if (veh->m_vehType != VEHICLE_TYPE_BIKE || veh->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE) {
if (veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) {
if (veh->m_vecMoveSpeed.Magnitude() < 0.17f && CTimer::GetTimeScale() >= 0.5f && !veh->bIsInWater) {
m_pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
m_pPed->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
}
}
} else {

View File

@ -12,14 +12,18 @@
#include "General.h"
int32 CWanted::MaximumWantedLevel = 6;
int32 CWanted::nMaximumWantedLevel = 6400;
int32 CWanted::nMaximumWantedLevel = 9600;
// --MIAMI: File done except stats
void
CWanted::Initialise()
{
m_nChaos = 0;
m_nMinChaos = 0;
m_nLastUpdateTime = 0;
m_nLastWantedLevelChange = 0;
m_nLastTimeSuspended = 0;
m_CurrentCops = 0;
m_MaxCops = 0;
m_MaximumLawEnforcerVehicles = 0;
@ -31,6 +35,7 @@ CWanted::Initialise()
m_bArmyRequired = false;
m_fCrimeSensitivity = 1.0f;
m_nWantedLevel = 0;
m_nMinWantedLevel = 0;
m_CopsBeatingSuspect = 0;
for (int i = 0; i < ARRAY_SIZE(m_pCops); i++)
@ -75,7 +80,7 @@ CWanted::NumOfHelisRequired()
return 1;
case 5:
case 6:
return 2;
return 1;
default:
return 0;
}
@ -93,22 +98,22 @@ CWanted::SetWantedLevel(int32 level)
m_nChaos = 0;
break;
case 1:
m_nChaos = 60;
m_nChaos = 70;
break;
case 2:
m_nChaos = 220;
m_nChaos = 200;
break;
case 3:
m_nChaos = 420;
m_nChaos = 570;
break;
case 4:
m_nChaos = 820;
m_nChaos = 1220;
break;
case 5:
m_nChaos = 1620;
m_nChaos = 2420;
break;
case 6:
m_nChaos = 3220;
m_nChaos = 4820;
break;
default:
break;
@ -119,10 +124,20 @@ CWanted::SetWantedLevel(int32 level)
void
CWanted::SetWantedLevelNoDrop(int32 level)
{
if (m_nWantedLevel < m_nMinWantedLevel)
SetWantedLevel(m_nMinWantedLevel);
if (level > m_nWantedLevel)
SetWantedLevel(level);
}
void
CWanted::CheatWantedLevel(int32 level)
{
SetWantedLevel(level);
UpdateWantedLevel();
}
void
CWanted::SetMaximumWantedLevel(int32 level)
{
@ -132,27 +147,27 @@ CWanted::SetMaximumWantedLevel(int32 level)
MaximumWantedLevel = 0;
break;
case 1:
nMaximumWantedLevel = 120;
nMaximumWantedLevel = 115;
MaximumWantedLevel = 1;
break;
case 2:
nMaximumWantedLevel = 300;
nMaximumWantedLevel = 365;
MaximumWantedLevel = 2;
break;
case 3:
nMaximumWantedLevel = 600;
nMaximumWantedLevel = 875;
MaximumWantedLevel = 3;
break;
case 4:
nMaximumWantedLevel = 1200;
nMaximumWantedLevel = 1800;
MaximumWantedLevel = 4;
break;
case 5:
nMaximumWantedLevel = 2400;
nMaximumWantedLevel = 3600;
MaximumWantedLevel = 5;
break;
case 6:
nMaximumWantedLevel = 4800;
nMaximumWantedLevel = 7200;
MaximumWantedLevel = 6;
break;
}
@ -167,7 +182,11 @@ CWanted::RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool po
void
CWanted::RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare)
{
#ifdef FIX_BUGS
if(!AddCrimeToQ(type, id, coors, true, policeDoesntCare))
#else
if(!AddCrimeToQ(type, id, coors, false, policeDoesntCare))
#endif
ReportCrimeNow(type, coors, policeDoesntCare);
}
@ -271,14 +290,25 @@ CWanted::ReportCrimeNow(eCrimeType type, const CVector &coors, bool policeDoesnt
case CRIME_DESTROYED_CESSNA:
m_nChaos += 500.0f*chaos;
break;
case CRIME_EXPLOSION:
m_nChaos += 25.0f * chaos;
break;
case CRIME_HIT_PED_NASTYWEAPON:
m_nChaos += 35.0f * chaos;
break;
case CRIME_HIT_COP_NASTYWEAPON:
m_nChaos += 100.0f * chaos;
break;
default:
// Error("Undefined crime type, RegisterCrime, Crime.cpp"); // different file for some reason
Error("Undefined crime type, RegisterCrime, Wanted.cpp");
}
m_nChaos = Max(m_nChaos, m_nMinChaos);
DMAudio.ReportCrime(type, coors);
UpdateWantedLevel();
}
// TODO(Miami): Stats
void
CWanted::UpdateWantedLevel()
{
@ -287,47 +317,41 @@ CWanted::UpdateWantedLevel()
if (m_nChaos > nMaximumWantedLevel)
m_nChaos = nMaximumWantedLevel;
if (m_nChaos >= 0 && m_nChaos < 40) {
if (m_nChaos >= 0 && m_nChaos < 50) {
m_nWantedLevel = 0;
m_MaximumLawEnforcerVehicles = 0;
m_MaxCops = 0;
m_RoadblockDensity = 0;
}
else if (m_nChaos >= 40 && m_nChaos < 200) {
} else if (m_nChaos >= 50 && m_nChaos < 180) {
m_nWantedLevel = 1;
m_MaximumLawEnforcerVehicles = 1;
m_MaxCops = 1;
m_RoadblockDensity = 0;
}
else if (m_nChaos >= 200 && m_nChaos < 400) {
} else if (m_nChaos >= 180 && m_nChaos < 550) {
m_nWantedLevel = 2;
m_MaximumLawEnforcerVehicles = 2;
m_MaxCops = 3;
m_RoadblockDensity = 0;
}
else if (m_nChaos >= 400 && m_nChaos < 800) {
} else if (m_nChaos >= 550 && m_nChaos < 1200) {
m_nWantedLevel = 3;
m_MaximumLawEnforcerVehicles = 2;
m_MaxCops = 4;
m_RoadblockDensity = 4;
}
else if (m_nChaos >= 800 && m_nChaos < 1600) {
m_RoadblockDensity = 12;
} else if (m_nChaos >= 1200 && m_nChaos < 2400) {
m_nWantedLevel = 4;
m_MaximumLawEnforcerVehicles = 2;
m_MaxCops = 6;
m_RoadblockDensity = 8;
}
else if (m_nChaos >= 1600 && m_nChaos < 3200) {
m_RoadblockDensity = 18;
} else if (m_nChaos >= 2400 && m_nChaos < 4800) {
m_nWantedLevel = 5;
m_MaximumLawEnforcerVehicles = 3;
m_MaxCops = 8;
m_RoadblockDensity = 10;
}
else if (m_nChaos >= 3200) {
m_RoadblockDensity = 24;
} else if (m_nChaos >= 4800) {
m_nWantedLevel = 6;
m_MaximumLawEnforcerVehicles = 3;
m_MaxCops = 10;
m_RoadblockDensity = 12;
m_RoadblockDensity = 30;
}
if (CurrWantedLevel != m_nWantedLevel)
@ -369,6 +393,10 @@ CWanted::WorkOutPolicePresence(CVector posn, float radius)
void
CWanted::Update(void)
{
if (CTimer::GetTimeInMilliseconds() > m_nLastTimeSuspended + 20000) {
m_nMinChaos = 0;
m_nMinWantedLevel = 0;
}
if (CTimer::GetTimeInMilliseconds() - m_nLastUpdateTime > 1000) {
if (m_nWantedLevel > 1) {
m_nLastUpdateTime = CTimer::GetTimeInMilliseconds();
@ -466,6 +494,12 @@ CWanted::UpdateCrimesQ(void)
void
CWanted::Suspend(void)
{
// TODO(MIAMI)!
Reset(); // <- temporary
// TODO(Miami): Stats
// dwStarsEvaded += m_nWantedLevel;
m_nMinChaos = m_nChaos;
m_nMinWantedLevel = m_nWantedLevel;
m_nLastTimeSuspended = CTimer::GetTimeInMilliseconds();
m_nChaos = 0;
m_nWantedLevel = 0;
ResetPolicePursuit();
}

View File

@ -9,8 +9,10 @@ class CWanted
{
public:
int32 m_nChaos;
int32 m_nMinChaos;
int32 m_nLastUpdateTime;
uint32 m_nLastWantedLevelChange;
uint32 m_nLastTimeSuspended;
float m_fCrimeSensitivity;
uint8 m_CurrentCops;
uint8 m_MaxCops;
@ -23,6 +25,7 @@ public:
uint8 m_bFbiRequired : 1;
uint8 m_bArmyRequired : 1;
int32 m_nWantedLevel;
int32 m_nMinWantedLevel;
CCrimeBeingQd m_aCrimes[16];
CCopPed *m_pCops[10];
@ -38,6 +41,7 @@ public:
int32 NumOfHelisRequired();
void SetWantedLevel(int32);
void SetWantedLevelNoDrop(int32 level);
void CheatWantedLevel(int32 level);
void RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
void RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
void ClearQdCrimes();

View File

@ -204,7 +204,6 @@ enum Config {
// Just debug menu entries
#ifdef DEBUGMENU
#define TOGGLEABLE_BETA_FEATURES // not too many things
#define RELOADABLES // some debug menu options to reload TXD files
#define MISSION_SWITCHER // from debug menu
#endif