diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-16 22:06:33 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-16 22:06:33 +0200 |
commit | b587d835e8d31c1e61b3eadbced099326c156644 (patch) | |
tree | 816f2c3f5a435a18a233de931518bca257a12a31 /src/core | |
parent | gangs, script and replay fixes (diff) | |
download | re3-b587d835e8d31c1e61b3eadbced099326c156644.tar re3-b587d835e8d31c1e61b3eadbced099326c156644.tar.gz re3-b587d835e8d31c1e61b3eadbced099326c156644.tar.bz2 re3-b587d835e8d31c1e61b3eadbced099326c156644.tar.lz re3-b587d835e8d31c1e61b3eadbced099326c156644.tar.xz re3-b587d835e8d31c1e61b3eadbced099326c156644.tar.zst re3-b587d835e8d31c1e61b3eadbced099326c156644.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Pad.cpp | 4 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 1 | ||||
-rw-r--r-- | src/core/PlayerInfo.h | 3 | ||||
-rw-r--r-- | src/core/Stats.cpp | 19 | ||||
-rw-r--r-- | src/core/Stats.h | 4 |
5 files changed, 29 insertions, 2 deletions
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index a40366ad..ae7fcdb4 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -100,7 +100,7 @@ void WeaponCheat() void HealthCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT3"), true); - FindPlayerPed()->m_fHealth = 100.0f; + FindPlayerPed()->m_fHealth = CWorld::Players[0].m_nMaxHealth; if (FindPlayerVehicle()) { FindPlayerVehicle()->m_fHealth = 1000.0f; if (FindPlayerVehicle()->m_vehType == VEHICLE_TYPE_CAR) @@ -224,7 +224,7 @@ void MoneyCheat() void ArmourCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT4"), true); - FindPlayerPed()->m_fArmour = 100.0f; + FindPlayerPed()->m_fArmour = CWorld::Players[0].m_nMaxArmour; } void WantedLevelUpCheat() diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index d7b3f0e5..48425a23 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -140,6 +140,7 @@ CPlayerInfo::Clear(void) m_nUpsideDownCounter = 0; m_bInfiniteSprint = false; m_bFastReload = false; + m_nMaxHealth = m_nMaxArmour = 100; m_bGetOutOfJailFree = false; m_bGetOutOfHospitalFree = false; m_nPreviousTimeRewardedForExplosion = 0; diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h index c649d49d..1b5778d5 100644 --- a/src/core/PlayerInfo.h +++ b/src/core/PlayerInfo.h @@ -52,6 +52,9 @@ public: int32 field_272; bool m_bInfiniteSprint; bool m_bFastReload; + bool m_bFireproof; + uint8 m_nMaxHealth; + uint8 m_nMaxArmour; bool m_bGetOutOfJailFree; bool m_bGetOutOfHospitalFree; char m_aSkinName[32]; diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index d50be0d5..a4bf409e 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -61,6 +61,7 @@ int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES]; int32 CStats::Sprayings; float CStats::AutoPaintingBudget; int32 CStats::NoMoreHurricanes; +float CStats::FashionBudget; void CStats::Init() { @@ -208,6 +209,19 @@ void CStats::SetTotalNumberMissions(int32 total) TotalNumberMissions = total; } +float CStats::GetPercentageProgress() +{ + float p; + if (TotalProgressInGame == 0.0f) + p = 0.0f; + else if (CGame::nastyGame) + p = 100.0f * ProgressMade / TotalProgressInGame; + else + p = 100.0f * ProgressMade / (TotalProgressInGame - 1); + + return Min(100.0f, p); +} + wchar *CStats::FindCriminalRatingString() { int rating = FindCriminalRatingNumber(); @@ -249,6 +263,11 @@ int32 CStats::FindCriminalRatingNumber() return rating; } +void CStats::MoneySpentOnFashion(int32 money) +{ + FashionBudget += money; +} + void CStats::SaveStats(uint8 *buf, uint32 *size) { CheckPointReachedSuccessfully(); diff --git a/src/core/Stats.h b/src/core/Stats.h index bf40a5a6..6ff74dc1 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -65,6 +65,7 @@ public: static int32 Sprayings; static float AutoPaintingBudget; static int32 NoMoreHurricanes; + static float FashionBudget; public: static void Init(void); @@ -88,6 +89,9 @@ public: static void CheckPointReachedSuccessfully() { TotalLegitimateKills += KillsSinceLastCheckpoint; KillsSinceLastCheckpoint = 0; }; static void CheckPointReachedUnsuccessfully() { KillsSinceLastCheckpoint = 0; }; static int32 FindCriminalRatingNumber(); + static float GetPercentageProgress(); static void SaveStats(uint8 *buf, uint32 *size); static void LoadStats(uint8 *buf, uint32 size); + + static void MoneySpentOnFashion(int32); }; |