2019-06-13 00:35:26 +00:00
|
|
|
#include "common.h"
|
2020-03-11 07:12:40 +00:00
|
|
|
#include "patcher.h"
|
2019-06-13 00:35:26 +00:00
|
|
|
#include "Stats.h"
|
|
|
|
|
2020-03-11 07:12:40 +00:00
|
|
|
WRAPPER void CStats::SaveStats(uint8 *buf, uint32 *size) { EAXJMP(0x4ab3e0); }
|
|
|
|
|
2019-06-16 22:16:38 +00:00
|
|
|
int32 &CStats::DaysPassed = *(int32*)0x8F2BB8;
|
2019-08-17 19:03:57 +00:00
|
|
|
int32 &CStats::HeadsPopped = *(int32*)0x8F647C;
|
2019-07-07 07:21:44 +00:00
|
|
|
bool& CStats::CommercialPassed = *(bool*)0x8F4334;
|
2019-07-10 09:36:47 +00:00
|
|
|
bool& CStats::IndustrialPassed = *(bool*)0x8E2A68;
|
2020-01-03 16:48:13 +00:00
|
|
|
bool& CStats::SuburbanPassed = *(bool*)0x8F2740;
|
2019-07-04 20:31:21 +00:00
|
|
|
int32 &CStats::NumberKillFrenziesPassed = *(int32*)0x8E287C;
|
|
|
|
int32 &CStats::PeopleKilledByOthers = *(int32*)0x8E2C50;
|
2019-08-03 22:31:00 +00:00
|
|
|
int32 &CStats::HelisDestroyed = *(int32*)0x8E2A64;
|
|
|
|
int32 *CStats::PedsKilledOfThisType = (int32*)0x880DBC;
|
2019-10-07 21:29:30 +00:00
|
|
|
int32 &CStats::TimesDied = *(int32*)0x8E2BDC;
|
|
|
|
int32 &CStats::TimesArrested = *(int32*)0x8E2BEC;
|
|
|
|
int32 &CStats::KillsSinceLastCheckpoint = *(int32*)0x8F2C8C;
|
2019-12-09 23:02:02 +00:00
|
|
|
int32& CStats::DistanceTravelledInVehicle = *(int32*)0x940574;
|
|
|
|
int32& CStats::DistanceTravelledOnFoot = *(int32*)0x941518;
|
2019-12-31 23:35:54 +00:00
|
|
|
int32 &CStats::ProgressMade = *(int32*)0x8F6224;
|
|
|
|
int32 &CStats::TotalProgressInGame = *(int32*)0x885B2C;
|
2020-01-07 14:37:20 +00:00
|
|
|
int32& CStats::CarsExploded = *(int32*)0x941288;
|
|
|
|
int32& CStats::PeopleKilledByPlayer = *(int32*)0x8F1B7C;
|
2019-12-31 23:35:54 +00:00
|
|
|
float &CStats::MaximumJumpDistance = *(float*)0x8F2BDC;
|
|
|
|
float &CStats::MaximumJumpHeight = *(float*)0x940564;
|
|
|
|
int32 &CStats::MaximumJumpFlips = *(int32*)0x8F2524;
|
|
|
|
int32 &CStats::MaximumJumpSpins = *(int32*)0x8F29B0;
|
|
|
|
int32 &CStats::BestStuntJump = *(int32*)0x885B50;
|
|
|
|
int32 &CStats::NumberOfUniqueJumpsFound = *(int32*)0x885B74;
|
|
|
|
int32 &CStats::TotalNumberOfUniqueJumps = *(int32*)0x8E2DC0;
|
|
|
|
int32 &CStats::PassengersDroppedOffWithTaxi = *(int32*)0x940724;
|
|
|
|
int32 &CStats::MoneyMadeWithTaxi = *(int32*)0x941544;
|
|
|
|
int32 &CStats::MissionsGiven = *(int32*)0x9430E8;
|
|
|
|
int32 &CStats::MissionsPassed = *(int32*)0x940768;
|
|
|
|
char(&CStats::LastMissionPassedName)[8] = *(char(*)[8])*(uintptr*)0x70D828;
|
|
|
|
int32 &CStats::TotalLegitimateKills = *(int32*)0x8F6004;
|
2020-02-15 11:53:42 +00:00
|
|
|
int32 &CStats::ElBurroTime = *(int32*)0x8E2A6C;
|
2020-02-16 20:08:54 +00:00
|
|
|
int32& CStats::Record4x4One = *(int32*)0x940570;
|
|
|
|
int32& CStats::Record4x4Two = *(int32*)0x94058C;
|
|
|
|
int32& CStats::Record4x4Three = *(int32*)0x880FA8;
|
|
|
|
int32& CStats::Record4x4Mayhem = *(int32*)0x885B70;
|
|
|
|
int32& CStats::LivesSavedWithAmbulance = *(int32*)0x8F57E0;
|
|
|
|
int32& CStats::CriminalsCaught = *(int32*)0x8F2518;
|
|
|
|
int32& CStats::HighestLevelAmbulanceMission = *(int32*)0x8F2A04;
|
|
|
|
int32& CStats::FiresExtinguished = *(int32*)0x8F5FEC;
|
|
|
|
int32& CStats::LongestFlightInDodo = *(int32*)0x8F5FE4;
|
|
|
|
int32& CStats::TimeTakenDefuseMission = *(int32*)0x880E24;
|
|
|
|
int32& CStats::TotalNumberKillFrenzies = *(int32*)0x8E2884;
|
|
|
|
int32& CStats::TotalNumberMissions = *(int32*)0x8E2820;
|
|
|
|
int32(&CStats::FastestTimes)[CStats::TOTAL_FASTEST_TIMES] = *(int32(*)[CStats::TOTAL_FASTEST_TIMES])*(uintptr*)0x6E9128;
|
|
|
|
int32(&CStats::HighestScores)[CStats::TOTAL_HIGHEST_SCORES] = *(int32(*)[CStats::TOTAL_HIGHEST_SCORES]) * (uintptr*)0x8622B0;
|
2019-07-04 20:31:21 +00:00
|
|
|
|
2020-02-16 20:08:54 +00:00
|
|
|
void CStats::RegisterFastestTime(int32 index, int32 time)
|
2019-07-04 20:31:21 +00:00
|
|
|
{
|
2020-02-16 20:08:54 +00:00
|
|
|
assert(index >= 0 && index < TOTAL_FASTEST_TIMES);
|
|
|
|
if (FastestTimes[index] == 0)
|
|
|
|
FastestTimes[index] = time;
|
|
|
|
else
|
|
|
|
FastestTimes[index] = min(FastestTimes[index], time);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::RegisterHighestScore(int32 index, int32 score)
|
|
|
|
{
|
|
|
|
assert(index >= 0 && index < TOTAL_HIGHEST_SCORES);
|
|
|
|
HighestScores[index] = max(HighestScores[index], score);
|
2019-08-03 22:31:00 +00:00
|
|
|
}
|
2020-02-15 11:53:42 +00:00
|
|
|
|
|
|
|
void CStats::RegisterElBurroTime(int32 time)
|
|
|
|
{
|
|
|
|
ElBurroTime = (ElBurroTime && ElBurroTime < time) ? ElBurroTime : time;
|
|
|
|
}
|
2020-02-16 20:08:54 +00:00
|
|
|
|
|
|
|
void CStats::Register4x4OneTime(int32 time)
|
|
|
|
{
|
|
|
|
Record4x4One = (Record4x4One && Record4x4One < time) ? Record4x4One : time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::Register4x4TwoTime(int32 time)
|
|
|
|
{
|
|
|
|
Record4x4Two = (Record4x4Two && Record4x4Two < time) ? Record4x4Two : time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::Register4x4ThreeTime(int32 time)
|
|
|
|
{
|
|
|
|
Record4x4Three = (Record4x4Three && Record4x4Three < time) ? Record4x4Three : time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::Register4x4MayhemTime(int32 time)
|
|
|
|
{
|
|
|
|
Record4x4Mayhem = (Record4x4Mayhem && Record4x4Mayhem < time) ? Record4x4Mayhem : time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::AnotherLifeSavedWithAmbulance()
|
|
|
|
{
|
|
|
|
++LivesSavedWithAmbulance;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::AnotherCriminalCaught()
|
|
|
|
{
|
|
|
|
++CriminalsCaught;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::RegisterLevelAmbulanceMission(int32 level)
|
|
|
|
{
|
|
|
|
HighestLevelAmbulanceMission = max(HighestLevelAmbulanceMission, level);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::AnotherFireExtinguished()
|
|
|
|
{
|
|
|
|
++FiresExtinguished;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::RegisterLongestFlightInDodo(int32 time)
|
|
|
|
{
|
|
|
|
LongestFlightInDodo = max(LongestFlightInDodo, time);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::RegisterTimeTakenDefuseMission(int32 time)
|
|
|
|
{
|
|
|
|
TimeTakenDefuseMission = (TimeTakenDefuseMission && TimeTakenDefuseMission < time) ? TimeTakenDefuseMission : time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::AnotherKillFrenzyPassed()
|
|
|
|
{
|
|
|
|
++NumberKillFrenziesPassed;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::SetTotalNumberKillFrenzies(int32 total)
|
|
|
|
{
|
|
|
|
TotalNumberKillFrenzies = total;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStats::SetTotalNumberMissions(int32 total)
|
|
|
|
{
|
|
|
|
TotalNumberMissions = total;
|
|
|
|
}
|