1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-14 16:19:16 +00:00

cheats, fixes, cosmetic changes

This commit is contained in:
majestic 2020-08-30 13:47:12 -07:00
parent b7456c604d
commit 9f43b1988b
14 changed files with 253 additions and 44 deletions

View file

@ -18,6 +18,8 @@
// TODO: figure out the meaning of this // TODO: figure out the meaning of this
enum { SOME_FLAG = 0x80 }; enum { SOME_FLAG = 0x80 };
bool CTrafficLights::bGreenLightsCheat;
void void
CTrafficLights::DisplayActualLight(CEntity *ent) CTrafficLights::DisplayActualLight(CEntity *ent)
{ {
@ -310,6 +312,12 @@ CTrafficLights::LightForPeds(void)
uint8 uint8
CTrafficLights::LightForCars1(void) CTrafficLights::LightForCars1(void)
{ {
if (CWeather::Wind > 1.1f)
return CAR_LIGHTS_GREEN;
if (bGreenLightsCheat)
return CAR_LIGHTS_GREEN;
uint32 period = CTimer::GetTimeInMilliseconds() % 16384; uint32 period = CTimer::GetTimeInMilliseconds() % 16384;
if(period < 5000) if(period < 5000)
@ -323,6 +331,12 @@ CTrafficLights::LightForCars1(void)
uint8 uint8
CTrafficLights::LightForCars2(void) CTrafficLights::LightForCars2(void)
{ {
if (CWeather::Wind > 1.1f)
return CAR_LIGHTS_GREEN;
if (bGreenLightsCheat)
return CAR_LIGHTS_GREEN;
uint32 period = CTimer::GetTimeInMilliseconds() % 16384; uint32 period = CTimer::GetTimeInMilliseconds() % 16384;
if(period < 6000) if(period < 6000)

View file

@ -16,6 +16,8 @@ enum {
class CTrafficLights class CTrafficLights
{ {
public: public:
static bool bGreenLightsCheat;
static void DisplayActualLight(CEntity *ent); static void DisplayActualLight(CEntity *ent);
static void ScanForLightsOnMap(void); static void ScanForLightsOnMap(void);
static int FindTrafficLightType(CEntity *light); static int FindTrafficLightType(CEntity *light);

View file

@ -5369,6 +5369,7 @@ CMenuManager::ConstructStatLine(int rowIdx)
STAT_LINE("FEST_CC", &CStats::CriminalsCaught, false, nil); STAT_LINE("FEST_CC", &CStats::CriminalsCaught, false, nil);
STAT_LINE("FEST_FE", &CStats::FiresExtinguished, false, nil); STAT_LINE("FEST_FE", &CStats::FiresExtinguished, false, nil);
STAT_LINE("DAYPLC", &(nTemp = CTimer::GetTimeInMilliseconds() + 100), false, nil); STAT_LINE("DAYPLC", &(nTemp = CTimer::GetTimeInMilliseconds() + 100), false, nil);
//TODO(MIAMI): move this function to the CStats and add reading of Stat lines tied with "MEDIA" for the "CHASESTAT" cheatcode
return counter; return counter;
#undef STAT_LINE #undef STAT_LINE

View file

@ -47,6 +47,7 @@
#include "platform.h" #include "platform.h"
#include "Stats.h" #include "Stats.h"
#include "CarCtrl.h" #include "CarCtrl.h"
#include "TrafficLights.h"
#ifdef GTA_PS2 #ifdef GTA_PS2
#include "eetypes.h" #include "eetypes.h"
@ -208,15 +209,20 @@ void HealthCheat()
} }
} }
void VehicleCheat(bool something, int model) void VehicleCheat(int model)
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
CStreaming::RequestModel(model, 0); CStreaming::RequestModel(model, STREAMFLAGS_DONT_REMOVE);
CStreaming::LoadAllRequestedModels(something); CStreaming::LoadAllRequestedModels(false);
if (CStreaming::ms_aInfoForModel[model].m_loadState == STREAMSTATE_LOADED) { if (CStreaming::ms_aInfoForModel[model].m_loadState == STREAMSTATE_LOADED) {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
int32 node = ThePaths.FindNodeClosestToCoors(FindPlayerCoors(), PATH_CAR, 100.0f);
if (!(CStreaming::ms_aInfoForModel[model].m_loadState & STREAMFLAGS_DONT_REMOVE)) {
CStreaming::SetModelIsDeletable(model);
CStreaming::SetModelTxdIsDeletable(model);
}
int32 node = ThePaths.FindNodeClosestToCoors(FindPlayerCoors(), PATH_CAR, 100.0f);
if (node < 0) return; if (node < 0) return;
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -362,18 +368,18 @@ void SunnyWeatherCheat()
CWeather::ForceWeatherNow(WEATHER_SUNNY); CWeather::ForceWeatherNow(WEATHER_SUNNY);
} }
void ExtraSunnyWeatherCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT7"), true);
CWeather::ForceWeatherNow(WEATHER_EXTRA_SUNNY);
}
void CloudyWeatherCheat() void CloudyWeatherCheat()
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT7"), true); CHud::SetHelpMessage(TheText.Get("CHEAT7"), true);
CWeather::ForceWeatherNow(WEATHER_CLOUDY); CWeather::ForceWeatherNow(WEATHER_CLOUDY);
} }
void StormyWeatherCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT7"), true);
CWeather::ForceWeatherNow(WEATHER_HURRICANE);
}
void RainyWeatherCheat() void RainyWeatherCheat()
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT7"), true); CHud::SetHelpMessage(TheText.Get("CHEAT7"), true);
@ -442,6 +448,12 @@ void PinkCarsCheat()
gbPinkCars = true; gbPinkCars = true;
} }
void TrafficLightsCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
CTrafficLights::bGreenLightsCheat = true;
}
void MadCarsCheat() void MadCarsCheat()
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
@ -548,6 +560,11 @@ void FlyingFishCheat(void)
CVehicle::bCheat8 = !CVehicle::bCheat8; CVehicle::bCheat8 = !CVehicle::bCheat8;
} }
void DoShowChaseStatCheat(void) {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
CStats::ShowChaseStatOnScreen = 1;
}
bool bool
CControllerState::CheckForInput(void) CControllerState::CheckForInput(void)
{ {
@ -1030,7 +1047,7 @@ void CPad::AddToCheatString(char c)
// "CCCCCC321TCT" - CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE R1 L2 L1 TRIANGLE CIRCLE TRIANGLE // "CCCCCC321TCT" - CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE R1 L2 L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT123CCCCCC") ) else if ( !_CHEATCMP("TCT123CCCCCC") )
VehicleCheat(true, MI_RHINO); VehicleCheat(MI_RHINO);
// "CCCSSSSS1TCT" - CIRCLE CIRCLE CIRCLE SQUARE SQUARE SQUARE SQUARE SQUARE L1 TRIANGLE CIRCLE TRIANGLE // "CCCSSSSS1TCT" - CIRCLE CIRCLE CIRCLE SQUARE SQUARE SQUARE SQUARE SQUARE L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT1SSSSSCCC") ) else if ( !_CHEATCMP("TCT1SSSSSCCC") )
@ -1142,19 +1159,22 @@ void CPad::AddToPCCheatString(char c)
// "APLEASANTDAY" // "APLEASANTDAY"
else if (!Cheat_strncmp(KeyBoardCheatString, "\\FKU[\\VHFW]I")) { else if (!Cheat_strncmp(KeyBoardCheatString, "\\FKU[\\VHFW]I")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
CloudyWeatherCheat(); SunnyWeatherCheat();
} }
// "ALOVELYDAY" // "ALOVELYDAY"
else if (!Cheat_strncmp(KeyBoardCheatString, "\\FKZY`YVML")) { else if (!Cheat_strncmp(KeyBoardCheatString, "\\FKZY`YVML")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
SunnyWeatherCheat(); ExtraSunnyWeatherCheat();
} }
// "ABITDRIEG" // "ABITDRIEG"
else if (!Cheat_strncmp(KeyBoardCheatString, "JJPSQoLIB")) {
KeyBoardCheatString[0] = ' ';
CloudyWeatherCheat();
}
// "CATSANDDOGS" // "CATSANDDOGS"
else if (!Cheat_strncmp(KeyBoardCheatString, "VLVEQiDZULP")) { else if (!Cheat_strncmp(KeyBoardCheatString, "VLVEQiDZULP")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
StormyWeatherCheat(); RainyWeatherCheat();
} }
// "CANTSEEATHING" // "CANTSEEATHING"
else if (!Cheat_strncmp(KeyBoardCheatString, "JSPIa\\HLT_[IJ")) { else if (!Cheat_strncmp(KeyBoardCheatString, "JSPIa\\HLT_[IJ")) {
@ -1164,10 +1184,13 @@ void CPad::AddToPCCheatString(char c)
// "PANZER" // "PANZER"
else if (!Cheat_strncmp(KeyBoardCheatString, "UJaONk")) { else if (!Cheat_strncmp(KeyBoardCheatString, "UJaONk")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_RHINO); VehicleCheat(MI_RHINO);
} }
// "LIFEISPASSINGMEBY" // "LIFEISPASSINGMEBY"
else if (!Cheat_strncmp(KeyBoardCheatString, "\\GLNTiLZTL][PeSOh")) {
KeyBoardCheatString[0] = ' ';
FastWeatherCheat();
}
// "BIGBANG" // "BIGBANG"
else if (!Cheat_strncmp(KeyBoardCheatString, "JSHCTdE")) { else if (!Cheat_strncmp(KeyBoardCheatString, "JSHCTdE")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
@ -1221,6 +1244,7 @@ void CPad::AddToPCCheatString(char c)
// "CHASESTAT" // "CHASESTAT"
else if (!Cheat_strncmp(KeyBoardCheatString, "WF[TRnDOD")) { else if (!Cheat_strncmp(KeyBoardCheatString, "WF[TRnDOD")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
DoShowChaseStatCheat();
} }
// "CHICKSWITHGUNS" // "CHICKSWITHGUNS"
else if (!Cheat_strncmp(KeyBoardCheatString, "VS\\HUoL^TVPQOc")) { else if (!Cheat_strncmp(KeyBoardCheatString, "VS\\HUoL^TVPQOc")) {
@ -1235,6 +1259,7 @@ void CPad::AddToPCCheatString(char c)
// "GREENLIGHT" // "GREENLIGHT"
else if (!Cheat_strncmp(KeyBoardCheatString, "WMNJYiHLSR")) { else if (!Cheat_strncmp(KeyBoardCheatString, "WMNJYiHLSR")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
TrafficLightsCheat();
} }
// "MIAMITRAFFIC" // "MIAMITRAFFIC"
else if (!Cheat_strncmp(KeyBoardCheatString, "FNMGNmWPNLVU")) { else if (!Cheat_strncmp(KeyBoardCheatString, "FNMGNmWPNLVU")) {
@ -1254,47 +1279,47 @@ void CPad::AddToPCCheatString(char c)
// "TRAVELINSTYLE" // "TRAVELINSTYLE"
else if (!Cheat_strncmp(KeyBoardCheatString, "HQ`U`iLSFaNZ[")) { else if (!Cheat_strncmp(KeyBoardCheatString, "HQ`U`iLSFaNZ[")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_BLOODRA); VehicleCheat(MI_BLOODRA);
} }
// "THELASTRIDE" // "THELASTRIDE"
else if (!Cheat_strncmp(KeyBoardCheatString, "HIPSanDSFSa")) { else if (!Cheat_strncmp(KeyBoardCheatString, "HIPSanDSFSa")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_ROMERO); VehicleCheat(MI_ROMERO);
} }
// "ROCKANDROLLCAR" // "ROCKANDROLLCAR"
else if (!Cheat_strncmp(KeyBoardCheatString, "UFJMYjUKOLXKVr")) { else if (!Cheat_strncmp(KeyBoardCheatString, "UFJMYjUKOLXKVr")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_LOVEFIST); VehicleCheat(MI_LOVEFIST);
} }
// "RUBBISHCAR" // "RUBBISHCAR"
else if (!Cheat_strncmp(KeyBoardCheatString, "UFJI`dEIV]")) { else if (!Cheat_strncmp(KeyBoardCheatString, "UFJI`dEIV]")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_TRASH); VehicleCheat(MI_TRASH);
} }
// "GETTHEREQUICKLY" // "GETTHEREQUICKLY"
else if (!Cheat_strncmp(KeyBoardCheatString, "\\QRDVpTLSPU\\[eT")) { else if (!Cheat_strncmp(KeyBoardCheatString, "\\QRDVpTLSPU\\[eT")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_BLOODRB); VehicleCheat(MI_BLOODRB);
} }
// "GETTHEREFAST" // "GETTHEREFAST"
else if (!Cheat_strncmp(KeyBoardCheatString, "WXHGRmHOU_RO")) { else if (!Cheat_strncmp(KeyBoardCheatString, "WXHGRmHOU_RO")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_SABRETUR); VehicleCheat(MI_SABRETUR);
} }
// "BETTERTHANWALKING" // "BETTERTHANWALKING"
else if (!Cheat_strncmp(KeyBoardCheatString, "JSPLY\\ZUBSaZLtaK^")) { else if (!Cheat_strncmp(KeyBoardCheatString, "JSPLY\\ZUBSaZLtaK^")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_CADDY); VehicleCheat(MI_CADDY);
} }
// "GETTHEREFASTINDEED" // "GETTHEREFASTINDEED"
else if (!Cheat_strncmp(KeyBoardCheatString, "GJLE[dWZBQfZLvRXa[^WHL")) { else if (!Cheat_strncmp(KeyBoardCheatString, "GJLE[dWZBQfZLvRXa[^WHL")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_HOTRINA); VehicleCheat(MI_HOTRINA);
} }
// "GETTHEREAMAZINGLYFAST" // "GETTHEREAMAZINGLYFAST"
else if (!Cheat_strncmp(KeyBoardCheatString, "WXHGfgJUJeNUHe_Kdg^HJ")) { else if (!Cheat_strncmp(KeyBoardCheatString, "WXHGfgJUJeNUHe_Kdg^HJ")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
VehicleCheat(true, MI_HOTRINB); VehicleCheat(MI_HOTRINB);
} }
// LOOKLIKELANCE // LOOKLIKELANCE
else if (!Cheat_strncmp(KeyBoardCheatString, "HHUBY`NPMV\\WS")) { else if (!Cheat_strncmp(KeyBoardCheatString, "HHUBY`NPMV\\WS")) {
@ -1346,6 +1371,16 @@ void CPad::AddToPCCheatString(char c)
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
ChangePlayerModel("igdiaz"); ChangePlayerModel("igdiaz");
} }
// DEEPFRIEDMARSBARS
else if (!Cheat_strncmp(KeyBoardCheatString, "VWHC`mDTEPVZMpRK")) {
KeyBoardCheatString[0] = ' ';
gfTommyFatness = 0.26f;
}
// PROGRAMMER
else if (!Cheat_strncmp(KeyBoardCheatString, "UJTNNmJVS[")) {
KeyBoardCheatString[0] = ' ';
gfTommyFatness = -0.3f;
}
// SEAWAYS // SEAWAYS
else if (!Cheat_strncmp(KeyBoardCheatString, "V^HXN`V")) { else if (!Cheat_strncmp(KeyBoardCheatString, "V^HXN`V")) {
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
@ -1366,17 +1401,6 @@ void CPad::AddToPCCheatString(char c)
KeyBoardCheatString[0] = ' '; KeyBoardCheatString[0] = ' ';
FannyMagnetCheat(); FannyMagnetCheat();
} }
// "ILOVESCOTLAND"
if (!_CHEATCMP("DNALTOCSEVOLI"))
RainyWeatherCheat();
// "MADWEATHER"
if (!_CHEATCMP("REHTAEWDAM"))
FastWeatherCheat();
// "CHITTYCHITTYBB"
if (!_CHEATCMP("BBYTTIHCYTTIHC"))
ChittyChittyBangBangCheat();
// "NASTYLIMBSCHEAT" // "NASTYLIMBSCHEAT"
if (!_CHEATCMP("TAEHCSBMILYTSAN")) if (!_CHEATCMP("TAEHCSBMILYTSAN"))
@ -3117,6 +3141,8 @@ void CPad::ResetCheats(void)
gbBlackCars = false; gbBlackCars = false;
gbPinkCars = false; gbPinkCars = false;
CCarCtrl::bMadDriversCheat = false; CCarCtrl::bMadDriversCheat = false;
CTrafficLights::bGreenLightsCheat = false;
CStats::ShowChaseStatOnScreen = 0;
gbFastTime = false; gbFastTime = false;
CTimer::SetTimeScale(1.0f); CTimer::SetTimeScale(1.0f);
} }

View file

@ -341,6 +341,30 @@ wchar *CStats::FindCriminalRatingString()
return TheText.Get(CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney > 10000000 ? "RATNG52" : "RATNG51"); return TheText.Get(CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney > 10000000 ? "RATNG52" : "RATNG51");
} }
wchar *CStats::FindChaseString(float fMediaLevel) {
if (fMediaLevel < 20.0f) return TheText.Get("MEDIA1");
if (fMediaLevel < 50.0f) return TheText.Get("MEDIA2");
if (fMediaLevel < 75.0f) return TheText.Get("MEDIA3");
if (fMediaLevel < 100.0f) return TheText.Get("MEDIA4");
if (fMediaLevel < 150.0f) return TheText.Get("MEDIA5");
if (fMediaLevel < 200.0f) return TheText.Get("MEDIA6");
if (fMediaLevel < 250.0f) return TheText.Get("MEDIA7");
if (fMediaLevel < 300.0f) return TheText.Get("MEDIA8");
if (fMediaLevel < 350.0f) return TheText.Get("MEDIA9");
if (fMediaLevel < 400.0f) return TheText.Get("MEDIA10");
if (fMediaLevel < 500.0f) return TheText.Get("MEDIA11");
if (fMediaLevel < 600.0f) return TheText.Get("MEDIA12");
if (fMediaLevel < 700.0f) return TheText.Get("MEDIA13");
if (fMediaLevel < 800.0f) return TheText.Get("MEDIA14");
if (fMediaLevel < 900.0f) return TheText.Get("MEDIA15");
if (fMediaLevel < 1000.0f) return TheText.Get("MEDIA16");
if (fMediaLevel < 1200.0f) return TheText.Get("MEDIA17");
if (fMediaLevel < 1400.0f) return TheText.Get("MEDIA18");
if (fMediaLevel < 1600.0f) return TheText.Get("MEDIA19");
if (fMediaLevel < 1800.0f) return TheText.Get("MEDIA20");
return TheText.Get("MEDIA21");
}
int32 CStats::FindCriminalRatingNumber() int32 CStats::FindCriminalRatingNumber()
{ {
int32 rating; int32 rating;

View file

@ -118,6 +118,7 @@ public:
static void RegisterLevelFireMission(int32); static void RegisterLevelFireMission(int32);
static void AnotherFireExtinguished(); static void AnotherFireExtinguished();
static wchar *FindCriminalRatingString(); static wchar *FindCriminalRatingString();
static wchar *FindChaseString(float fMediaLevel);
static void AnotherKillFrenzyPassed(); static void AnotherKillFrenzyPassed();
static void SetTotalNumberKillFrenzies(int32); static void SetTotalNumberKillFrenzies(int32);
static void SetTotalNumberMissions(int32); static void SetTotalNumberMissions(int32);

View file

@ -80,7 +80,7 @@ void WeaponCheat1();
void WeaponCheat2(); void WeaponCheat2();
void WeaponCheat3(); void WeaponCheat3();
void HealthCheat(); void HealthCheat();
void VehicleCheat(bool something, int model); void VehicleCheat(int model);
void BlowUpCarsCheat(); void BlowUpCarsCheat();
void ChangePlayerCheat(); void ChangePlayerCheat();
void MayhemCheat(); void MayhemCheat();
@ -353,7 +353,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Health", HealthCheat); DebugMenuAddCmd("Cheats", "Health", HealthCheat);
DebugMenuAddCmd("Cheats", "Wanted level up", WantedLevelUpCheat); DebugMenuAddCmd("Cheats", "Wanted level up", WantedLevelUpCheat);
DebugMenuAddCmd("Cheats", "Wanted level down", WantedLevelDownCheat); DebugMenuAddCmd("Cheats", "Wanted level down", WantedLevelDownCheat);
DebugMenuAddCmd("Cheats", "Tank", []() { VehicleCheat(true, MI_TAXI); }); DebugMenuAddCmd("Cheats", "Tank", []() { VehicleCheat(MI_TAXI); });
DebugMenuAddCmd("Cheats", "Blow up cars", BlowUpCarsCheat); DebugMenuAddCmd("Cheats", "Blow up cars", BlowUpCarsCheat);
DebugMenuAddCmd("Cheats", "Change player", ChangePlayerCheat); DebugMenuAddCmd("Cheats", "Change player", ChangePlayerCheat);
DebugMenuAddCmd("Cheats", "Mayhem", MayhemCheat); DebugMenuAddCmd("Cheats", "Mayhem", MayhemCheat);

View file

@ -145,6 +145,8 @@ void *CPed::operator new(size_t sz, int handle) { return CPools::GetPedPool()->N
void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); } void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); }
void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); } void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); }
float gfTommyFatness = 1.0f;
// --MIAMI: Done // --MIAMI: Done
CPed::~CPed(void) CPed::~CPed(void)
{ {
@ -16441,7 +16443,78 @@ CPed::PreRender(void)
RwMatrixScale(head, &zero, rwCOMBINEPRECONCAT); RwMatrixScale(head, &zero, rwCOMBINEPRECONCAT);
} }
// TODO(Miami): Some cheat?? if (IsPlayer() && gfTommyFatness != 1.0f) {
RpHAnimHierarchy* hier = GetAnimHierarchyFromSkinClump(GetClump());
int32 idx;
RwV3d scale;
scale.x = 1.0f;
scale.y = 1.0f + gfTommyFatness * 0.7f;
scale.z = 1.0f + gfTommyFatness * 0.7f;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_HEAD));
RwMatrix* head = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(head, &scale, rwCOMBINEPRECONCAT);
scale.y = 1.0f + gfTommyFatness * 0.2f;
scale.z = 1.0f + gfTommyFatness * 0.2f;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_NECK));
RwMatrix* neck = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(neck, &scale, rwCOMBINEPRECONCAT);
scale.y = 1.0f + gfTommyFatness * 0.5f;
scale.z = 1.0f + gfTommyFatness * 0.5f;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_MID));
RwMatrix* mid = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(mid, &scale, rwCOMBINEPRECONCAT);
scale.y = 1.0f + gfTommyFatness;
scale.z = 1.0f + gfTommyFatness;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_UPPERLEGL));
RwMatrix* upperLegL = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(upperLegL, &scale, rwCOMBINEPRECONCAT);
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_UPPERLEGR));
RwMatrix* upperLegR = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(upperLegR, &scale, rwCOMBINEPRECONCAT);
scale.y = 1.0f + gfTommyFatness * 0.5f;
scale.z = 1.0f + gfTommyFatness * 0.5f;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_LOWERLEGR));
RwMatrix* lowerLegR = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(lowerLegR, &scale, rwCOMBINEPRECONCAT);
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_LOWERLEGL));
RwMatrix* lowerLegL = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(lowerLegL, &scale, rwCOMBINEPRECONCAT);
scale.y = 1.0f + gfTommyFatness * 0.23f;
scale.z = 1.0f + gfTommyFatness * 0.23f;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_FOOTL));
RwMatrix* footL = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(footL, &scale, rwCOMBINEPRECONCAT);
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_FOOTR));
RwMatrix* footR = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(footR, &scale, rwCOMBINEPRECONCAT);
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_UPPERARML));
RwMatrix* upperArmL = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(upperArmL, &scale, rwCOMBINEPRECONCAT);
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_UPPERARMR));
RwMatrix* upperArmR = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(upperArmR, &scale, rwCOMBINEPRECONCAT);
scale.y = 1.0f + gfTommyFatness * 0.2f;
scale.z = 1.0f + gfTommyFatness * 0.2f;
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_FOREARML));
RwMatrix* foreArmL = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(foreArmL, &scale, rwCOMBINEPRECONCAT);
idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_FOREARMR));
RwMatrix* foreArmR = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
RwMatrixScale(foreArmR, &scale, rwCOMBINEPRECONCAT);
}
if (bBodyPartJustCameOff && bIsPedDieAnimPlaying && m_bodyPartBleeding != -1 && (CTimer::GetFrameCounter() & 7) > 3) { if (bBodyPartJustCameOff && bIsPedDieAnimPlaying && m_bodyPartBleeding != -1 && (CTimer::GetFrameCounter() & 7) > 3) {
CVector bloodDir(0.0f, 0.0f, 0.0f); CVector bloodDir(0.0f, 0.0f, 0.0f);

View file

@ -358,6 +358,8 @@ enum eMoveState {
PEDMOVE_THROWN PEDMOVE_THROWN
}; };
extern float gfTommyFatness;
class CVehicle; class CVehicle;
class CPed : public CPhysical class CPed : public CPhysical

View file

@ -1611,13 +1611,13 @@ void CScriptPath::Clear(void) {
m_state = SCRIPT_PATH_DISABLED; m_state = SCRIPT_PATH_DISABLED;
} }
void CScriptPath::InitialiseOne(int32 numNodes, float width) { void CScriptPath::InitialiseOne(int32 numNodes, float length) {
char Dest[32]; char Dest[32];
sprintf(Dest, "data\\paths\\spath%d.dat", numNodes); sprintf(Dest, "data\\paths\\spath%d.dat", numNodes);
m_pNode = CPlane::LoadPath(Dest, m_numNodes, m_fTotalLength, false); m_pNode = CPlane::LoadPath(Dest, m_numNodes, m_fTotalLength, false);
m_fSpeed = 1.0f; m_fSpeed = 1.0f;
m_fPosition = 0.0f; m_fPosition = 0.0f;
m_fObjectLength = width; m_fObjectLength = length;
m_state = SCRIPT_PATH_INITIALIZED; m_state = SCRIPT_PATH_INITIALIZED;
} }

View file

@ -24,7 +24,7 @@ public:
void Clear(void); void Clear(void);
void Update(void); void Update(void);
void InitialiseOne(int32 numNodes, float width); void InitialiseOne(int32 numNodes, float length);
void FindCoorsFromDistanceOnPath(float t, float *pX, float *pY, float *pZ); void FindCoorsFromDistanceOnPath(float t, float *pX, float *pY, float *pZ);
void SetObjectToControl(CObject *pObj); void SetObjectToControl(CObject *pObj);
}; };

View file

@ -21,6 +21,8 @@
#include "User.h" #include "User.h"
#include "World.h" #include "World.h"
#include "CutsceneMgr.h" #include "CutsceneMgr.h"
#include "Stats.h"
#include "main.h"
// Game has colors inlined in code. // Game has colors inlined in code.
// For easier modification we collect them here: // For easier modification we collect them here:
@ -91,6 +93,8 @@ float CHud::PagerXOffset;
int16 CHud::PagerTimer; int16 CHud::PagerTimer;
int16 CHud::PagerOn; int16 CHud::PagerOn;
wchar *prevChaseString;
uint32 CHud::m_WantedFadeTimer; uint32 CHud::m_WantedFadeTimer;
uint32 CHud::m_WantedState; uint32 CHud::m_WantedState;
uint32 CHud::m_WantedTimer; uint32 CHud::m_WantedTimer;
@ -524,6 +528,53 @@ void CHud::Draw()
} }
} }
static int32 nMediaLevelCounter = 0;
if (CStats::ShowChaseStatOnScreen != 0) {
float fCurAttentionLevel = CWorld::Players[CWorld::PlayerInFocus].m_fMediaAttention;
if (0.7f * CStats::HighestChaseValue > fCurAttentionLevel
|| fCurAttentionLevel <= 40.0f || CTheScripts::IsPlayerOnAMission()) {
nMediaLevelCounter = 0;
}
else {
if (fCurAttentionLevel == CStats::HighestChaseValue) {
sprintf(gString, "%s %d", UnicodeToAscii(TheText.Get("CHSE")), (int32)fCurAttentionLevel);
}
else {
sprintf(gString, "%s %d" "-%d-", UnicodeToAscii(TheText.Get("CHSE")), (int32)fCurAttentionLevel, (int32)CStats::HighestChaseValue);
}
AsciiToUnicode(gString, gUString);
CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(HUD_TEXT_SCALE_X), SCREEN_SCALE_Y(HUD_TEXT_SCALE_Y));
CFont::SetCentreOff();
CFont::SetRightJustifyOn();
CFont::SetRightJustifyWrap(0.0f);
CFont::SetBackGroundOnlyTextOff();
CFont::SetFontStyle(FONT_HEADING);
CFont::SetPropOff();
CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CRGBA colour;
if (CTimer::GetTimeInMilliseconds() & 0x200)
colour = CRGBA(204, 0, 185, 180);
else
colour = CRGBA(178, 0, 162, 180);
CFont::SetColor(colour);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(113.0f), gUString);
if (CStats::FindChaseString(fCurAttentionLevel) != prevChaseString) {
prevChaseString = CStats::FindChaseString(fCurAttentionLevel);
nMediaLevelCounter = 100;
}
if (nMediaLevelCounter != 0) {
nMediaLevelCounter--;
UnicodeMakeUpperCase(gUString, CStats::FindChaseString(fCurAttentionLevel));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(138.0f), gUString);
}
}
}
/* /*
DrawZoneName DrawZoneName
*/ */

View file

@ -494,6 +494,20 @@ UnicodeToAsciiForMemoryCard(wchar *src)
return aStr; return aStr;
} }
void
UnicodeMakeUpperCase(wchar *dst, wchar *src) //idk what to do with it, seems to be incorrect implementation by R*
{
while (*src != '\0') {
if (*src < 'a' || *src > 'z')
*dst = *src;
else
*dst = *src - 32;
dst++;
src++;
}
*dst = '\0';
}
void void
UnicodeStrcpy(wchar *dst, const wchar *src) UnicodeStrcpy(wchar *dst, const wchar *src)
{ {

View file

@ -8,6 +8,7 @@ void UnicodeStrcpy(wchar *dst, const wchar *src);
void UnicodeStrcat(wchar *dst, wchar *append); void UnicodeStrcat(wchar *dst, wchar *append);
int UnicodeStrlen(const wchar *str); int UnicodeStrlen(const wchar *str);
void TextCopy(wchar *dst, const wchar *src); void TextCopy(wchar *dst, const wchar *src);
void UnicodeMakeUpperCase(wchar *dst, wchar *src);
struct CKeyEntry struct CKeyEntry
{ {