diff --git a/src/gtasa/effects/custom/ped/CoughEffect.cpp b/src/gtasa/effects/custom/ped/CoughEffect.cpp index 813a274d..16e2da91 100644 --- a/src/gtasa/effects/custom/ped/CoughEffect.cpp +++ b/src/gtasa/effects/custom/ped/CoughEffect.cpp @@ -9,10 +9,10 @@ class CoughEffect : public EffectBase { private: int timer = 0; - const int MIN_COUGH_TIME_SEC = 3; + const int MIN_COUGH_TIME_SEC = 2; const int MAX_COUGH_TIME_SEC = 4; - const int MAX_WAIT_TIME_SEC = 7; - const int MIN_WAIT_TIME_SEC = 5; + const int MAX_WAIT_TIME_SEC = 8; + const int MIN_WAIT_TIME_SEC = 6; bool isPlayerOnly = false; public: @@ -60,11 +60,13 @@ class CoughEffect : public EffectBase if (!ped) return; auto *vehicle = ped->m_pVehicle; - if (vehicle && vehicle->m_pDriver == ped - && vehicle->m_vecMoveSpeed.Magnitude () > 0.15f) + bool cond = vehicle && vehicle->m_pDriver == ped; + cond &= vehicle && vehicle->m_vecMoveSpeed.Magnitude () > 0.15f; + cond &= inst->Random (0, 100000) % 2 == 0; + if (cond) { auto speed = vehicle->m_vecMoveSpeed.Magnitude () - * (inst->Random (0, 1) ? 0.12f : -0.12f); + * (inst->Random (0, 1) ? 0.08f : -0.08f); vehicle->m_vecTurnSpeed.z = speed; } if (!ped->m_nPedFlags.bInVehicle) @@ -74,13 +76,13 @@ class CoughEffect : public EffectBase Command ( ped, "gas_cwr", "ped", 4.0, 1, 1, 1, 0, sec); } - ped->m_fHealth -= ped->m_fMaxHealth * 0.02f; + ped->m_fHealth -= ped->m_fMaxHealth * 0.05f; ped->m_fHealth = std::max (0.0f, ped->m_fHealth); int res = 0; int speechBank = 340; Command ( - ped, speechBank, 1, 1, 1 & res); + ped, speechBank, 1, 1, 1, &res); } };