2019-05-30 21:24:47 +02:00
|
|
|
#include "common.h"
|
2020-04-17 15:31:11 +02:00
|
|
|
|
2019-07-04 22:31:21 +02:00
|
|
|
#include "main.h"
|
2019-05-30 21:24:47 +02:00
|
|
|
#include "Darkel.h"
|
2019-10-05 15:44:03 +02:00
|
|
|
#include "PlayerPed.h"
|
2020-03-28 15:47:52 +01:00
|
|
|
#include "Wanted.h"
|
2019-07-04 22:31:21 +02:00
|
|
|
#include "Timer.h"
|
|
|
|
#include "DMAudio.h"
|
|
|
|
#include "Population.h"
|
|
|
|
#include "Weapon.h"
|
|
|
|
#include "World.h"
|
|
|
|
#include "Stats.h"
|
|
|
|
#include "Font.h"
|
|
|
|
#include "Text.h"
|
2020-01-07 15:37:20 +01:00
|
|
|
#include "Vehicle.h"
|
2020-05-31 19:59:01 +02:00
|
|
|
#include "GameLogic.h"
|
2020-01-07 15:37:20 +01:00
|
|
|
|
|
|
|
#define FRENZY_ANY_PED -1
|
|
|
|
#define FRENZY_ANY_CAR -2
|
2019-05-30 21:24:47 +02:00
|
|
|
|
2020-04-16 21:19:56 +02:00
|
|
|
int32 CDarkel::TimeLimit;
|
|
|
|
int32 CDarkel::PreviousTime;
|
|
|
|
int32 CDarkel::TimeOfFrenzyStart;
|
|
|
|
int32 CDarkel::WeaponType;
|
|
|
|
int32 CDarkel::AmmoInterruptedWeapon;
|
|
|
|
int32 CDarkel::KillsNeeded;
|
|
|
|
int8 CDarkel::InterruptedWeapon;
|
2019-10-05 15:44:03 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* bStandardSoundAndMessages is a completely beta thing,
|
|
|
|
* makes game handle sounds & messages instead of SCM (just like in GTA2)
|
|
|
|
* but it's never been used in the game. Has unused sliding text when frenzy completed etc.
|
|
|
|
*/
|
2020-04-16 21:19:56 +02:00
|
|
|
int8 CDarkel::bStandardSoundAndMessages;
|
|
|
|
int8 CDarkel::bNeedHeadShot;
|
|
|
|
int8 CDarkel::bProperKillFrenzy;
|
|
|
|
uint16 CDarkel::Status;
|
|
|
|
uint16 CDarkel::RegisteredKills[NUM_DEFAULT_MODELS];
|
|
|
|
int32 CDarkel::ModelToKill;
|
|
|
|
int32 CDarkel::ModelToKill2;
|
|
|
|
int32 CDarkel::ModelToKill3;
|
|
|
|
int32 CDarkel::ModelToKill4;
|
|
|
|
wchar *CDarkel::pStartMessage;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
uint8
|
|
|
|
CDarkel::CalcFade(uint32 time, uint32 start, uint32 end)
|
|
|
|
{
|
2019-07-07 09:13:04 +02:00
|
|
|
if (time >= start && time <= end) {
|
|
|
|
if (time >= start + 500) {
|
|
|
|
if (time <= end - 500)
|
2019-07-07 20:59:49 +02:00
|
|
|
return 255;
|
2019-07-04 22:31:21 +02:00
|
|
|
else
|
2019-07-07 09:13:04 +02:00
|
|
|
return 255 * (end - time) / 500;
|
2019-10-05 15:44:03 +02:00
|
|
|
} else
|
2019-07-07 09:13:04 +02:00
|
|
|
return 255 * (time - start) / 500;
|
2019-10-05 15:44:03 +02:00
|
|
|
} else
|
2019-07-04 22:31:21 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
// Screen positions taken from VC
|
|
|
|
void
|
|
|
|
CDarkel::DrawMessages()
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
|
|
|
switch (Status) {
|
2019-10-05 15:44:03 +02:00
|
|
|
case KILLFRENZY_ONGOING:
|
|
|
|
{
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(30.0f));
|
|
|
|
CFont::SetCentreOn();
|
|
|
|
CFont::SetPropOn();
|
|
|
|
uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart;
|
|
|
|
if (CDarkel::bStandardSoundAndMessages) {
|
|
|
|
if (timePassedSinceStart >= 3000 && timePassedSinceStart < 11000) {
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.3f), SCREEN_SCALE_Y(1.3f));
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetColor(CRGBA(255, 255, 128, CalcFade(timePassedSinceStart, 3000, 11000)));
|
2020-06-07 03:10:06 +02:00
|
|
|
CFont::SetFontStyle(FONT_STANDARD);
|
2019-10-05 15:44:03 +02:00
|
|
|
if (pStartMessage) {
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, pStartMessage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (timePassedSinceStart < 8000) {
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.3f), SCREEN_SCALE_Y(1.3f));
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetColor(CRGBA(255, 255, 128, CalcFade(timePassedSinceStart, 0, 8000)));
|
2020-06-07 03:10:06 +02:00
|
|
|
CFont::SetFontStyle(FONT_STANDARD);
|
2019-10-05 15:44:03 +02:00
|
|
|
if (pStartMessage) {
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, pStartMessage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.75f), SCREEN_SCALE_Y(1.5f));
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
|
|
|
if (CDarkel::TimeLimit >= 0) {
|
|
|
|
uint32 timeLeft = CDarkel::TimeLimit - (CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart);
|
|
|
|
sprintf(gString, "%d:%02d", timeLeft / 60000, timeLeft % 60000 / 1000);
|
|
|
|
AsciiToUnicode(gString, gUString);
|
|
|
|
if (timeLeft > 4000 || CTimer::GetFrameCounter() & 1) {
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(109.0f), gUString);
|
|
|
|
CFont::SetColor(CRGBA(150, 100, 255, 255));
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(34.0f), SCREEN_SCALE_Y(108.0f), gUString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sprintf(gString, "%d", (CDarkel::KillsNeeded >= 0 ? CDarkel::KillsNeeded : 0));
|
2019-07-04 22:31:21 +02:00
|
|
|
AsciiToUnicode(gString, gUString);
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2019-10-05 15:44:03 +02:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(144.0f), gUString);
|
|
|
|
CFont::SetColor(CRGBA(255, 128, 128, 255));
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(34.0f), SCREEN_SCALE_Y(143.0f), gUString);
|
|
|
|
break;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
2019-10-05 15:44:03 +02:00
|
|
|
case KILLFRENZY_PASSED:
|
|
|
|
{
|
|
|
|
if (CDarkel::bStandardSoundAndMessages) {
|
|
|
|
uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart;
|
|
|
|
if (CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart < 5000) {
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f));
|
|
|
|
CFont::SetCentreOn();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f));
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetColor(CRGBA(128, 255, 128, CalcFade(timePassedSinceStart, 0, 5000)));
|
2020-06-07 03:10:06 +02:00
|
|
|
CFont::SetFontStyle(FONT_STANDARD);
|
2019-10-05 15:44:03 +02:00
|
|
|
int y = SCREEN_HEIGHT / 2 + SCREEN_SCALE_Y(25.0f - timePassedSinceStart * 0.01f);
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2, y, TheText.Get("KF_3"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
void
|
|
|
|
CDarkel::Init()
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2019-07-07 09:13:04 +02:00
|
|
|
Status = KILLFRENZY_NONE;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
uint16
|
|
|
|
CDarkel::QueryModelsKilledByPlayer(int32 modelId)
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
|
|
|
return RegisteredKills[modelId];
|
|
|
|
}
|
2019-06-15 01:34:19 +02:00
|
|
|
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
bool
|
|
|
|
CDarkel::FrenzyOnGoing()
|
2019-06-17 02:10:55 +02:00
|
|
|
{
|
2019-07-04 22:31:21 +02:00
|
|
|
return Status == KILLFRENZY_ONGOING;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
uint16
|
|
|
|
CDarkel::ReadStatus()
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2020-01-07 15:37:20 +01:00
|
|
|
void
|
|
|
|
CDarkel::RegisterCarBlownUpByPlayer(CVehicle *vehicle)
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2020-01-07 15:37:20 +01:00
|
|
|
if (FrenzyOnGoing()) {
|
|
|
|
int32 model = vehicle->GetModelIndex();
|
|
|
|
if (ModelToKill == FRENZY_ANY_CAR || ModelToKill == model || ModelToKill2 == model || ModelToKill3 == model || ModelToKill4 == model) {
|
|
|
|
KillsNeeded--;
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_CAR_BLOWN, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RegisteredKills[vehicle->GetModelIndex()]++;
|
|
|
|
CStats::CarsExploded++;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
|
2020-01-07 15:37:20 +01:00
|
|
|
void
|
|
|
|
CDarkel::RegisterKillByPlayer(CPed *victim, eWeaponType weapon, bool headshot)
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2020-01-07 15:37:20 +01:00
|
|
|
if (FrenzyOnGoing() && (weapon == WeaponType
|
|
|
|
|| weapon == WEAPONTYPE_EXPLOSION
|
|
|
|
|| weapon == WEAPONTYPE_UZI_DRIVEBY && WeaponType == WEAPONTYPE_UZI
|
|
|
|
|| weapon == WEAPONTYPE_RAMMEDBYCAR && WeaponType == WEAPONTYPE_RUNOVERBYCAR
|
|
|
|
|| weapon == WEAPONTYPE_RUNOVERBYCAR && WeaponType == WEAPONTYPE_RAMMEDBYCAR
|
|
|
|
|| weapon == WEAPONTYPE_FLAMETHROWER && WeaponType == WEAPONTYPE_MOLOTOV)) {
|
|
|
|
int32 model = victim->GetModelIndex();
|
|
|
|
if (ModelToKill == FRENZY_ANY_PED || ModelToKill == model || ModelToKill2 == model || ModelToKill3 == model || ModelToKill4 == model) {
|
|
|
|
if (!bNeedHeadShot || headshot) {
|
|
|
|
KillsNeeded--;
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_KILL, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CStats::PeopleKilledByPlayer++;
|
|
|
|
RegisteredKills[victim->GetModelIndex()]++;
|
|
|
|
CStats::PedsKilledOfThisType[victim->bChrisCriminal ? PEDTYPE_CRIMINAL : victim->m_nPedType]++;
|
|
|
|
if (headshot)
|
|
|
|
CStats::HeadsPopped++;
|
|
|
|
CStats::KillsSinceLastCheckpoint++;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
void
|
|
|
|
CDarkel::RegisterKillNotByPlayer(CPed* victim, eWeaponType weapontype)
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2020-01-07 15:37:20 +01:00
|
|
|
CStats::PeopleKilledByOthers++;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
void
|
|
|
|
CDarkel::ResetModelsKilledByPlayer()
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2019-10-06 23:39:25 +02:00
|
|
|
for (int i = 0; i < NUM_DEFAULT_MODELS; i++)
|
2019-07-07 09:13:04 +02:00
|
|
|
RegisteredKills[i] = 0;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
void
|
|
|
|
CDarkel::ResetOnPlayerDeath()
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2019-07-07 09:13:04 +02:00
|
|
|
if (Status != KILLFRENZY_ONGOING)
|
|
|
|
return;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
CPopulation::m_AllRandomPedsThisType = -1;
|
|
|
|
Status = KILLFRENZY_FAILED;
|
|
|
|
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
eWeaponType fixedWeapon;
|
2019-07-07 09:13:04 +02:00
|
|
|
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
2019-10-05 15:44:03 +02:00
|
|
|
fixedWeapon = WEAPONTYPE_UZI;
|
|
|
|
else
|
|
|
|
fixedWeapon = (eWeaponType)WeaponType;
|
2019-07-07 09:13:04 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
CPlayerPed *player = FindPlayerPed();
|
|
|
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
|
|
|
player->m_nSelectedWepSlot = InterruptedWeapon;
|
|
|
|
player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal = CDarkel::AmmoInterruptedWeapon;
|
2019-07-07 09:13:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (FindPlayerVehicle()) {
|
2019-10-05 15:44:03 +02:00
|
|
|
player->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nModelId);
|
|
|
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
|
|
|
player->MakeChangesForNewWeapon(player->m_currentWeapon);
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
void
|
|
|
|
CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, uint16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot)
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2020-05-31 19:59:01 +02:00
|
|
|
CGameLogic::ClearShortCut();
|
|
|
|
CGameLogic::RemoveShortCutDropOffPointForMission();
|
2019-10-05 15:44:03 +02:00
|
|
|
eWeaponType fixedWeapon;
|
2019-07-04 22:31:21 +02:00
|
|
|
if (weaponType == WEAPONTYPE_UZI_DRIVEBY)
|
2019-10-05 15:44:03 +02:00
|
|
|
fixedWeapon = WEAPONTYPE_UZI;
|
|
|
|
else
|
|
|
|
fixedWeapon = weaponType;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
|
|
|
WeaponType = weaponType;
|
|
|
|
Status = KILLFRENZY_ONGOING;
|
|
|
|
KillsNeeded = kill;
|
|
|
|
ModelToKill = modelId0;
|
|
|
|
ModelToKill2 = modelId2;
|
|
|
|
ModelToKill3 = modelId3;
|
|
|
|
ModelToKill4 = modelId4;
|
|
|
|
pStartMessage = text;
|
|
|
|
|
|
|
|
if (text == TheText.Get("PAGE_00")) {
|
2020-04-16 21:19:56 +02:00
|
|
|
CDarkel::bProperKillFrenzy = true;
|
|
|
|
CDarkel::pStartMessage = nil;
|
2019-10-05 15:44:03 +02:00
|
|
|
} else
|
2020-04-16 21:19:56 +02:00
|
|
|
bProperKillFrenzy = false;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
|
|
|
bStandardSoundAndMessages = standardSound;
|
|
|
|
bNeedHeadShot = needHeadShot;
|
|
|
|
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
|
|
|
TimeLimit = time;
|
|
|
|
PreviousTime = time / 1000;
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
CPlayerPed *player = FindPlayerPed();
|
|
|
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
|
|
|
InterruptedWeapon = player->m_currentWeapon;
|
|
|
|
player->GiveWeapon(fixedWeapon, 0);
|
|
|
|
AmmoInterruptedWeapon = player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal;
|
|
|
|
player->GiveWeapon(fixedWeapon, 30000);
|
|
|
|
player->m_nSelectedWepSlot = player->GetWeaponSlot(fixedWeapon);
|
|
|
|
player->MakeChangesForNewWeapon(player->m_nSelectedWepSlot);
|
2019-07-04 22:31:21 +02:00
|
|
|
|
|
|
|
if (FindPlayerVehicle()) {
|
2019-10-05 15:44:03 +02:00
|
|
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
2020-04-19 18:34:08 +02:00
|
|
|
player->GetWeapon()->m_nAmmoInClip = Min(player->GetWeapon()->m_nAmmoTotal, CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition);
|
2019-10-05 15:44:03 +02:00
|
|
|
player->ClearWeaponTarget();
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CDarkel::bStandardSoundAndMessages)
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_START, 0);
|
|
|
|
}
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
void
|
|
|
|
CDarkel::Update()
|
2019-07-04 22:31:21 +02:00
|
|
|
{
|
2019-07-07 09:13:04 +02:00
|
|
|
if (Status != KILLFRENZY_ONGOING)
|
|
|
|
return;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
int32 FrameTime = TimeLimit - (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart);
|
2019-10-13 21:44:39 +02:00
|
|
|
if (FrameTime > 0 || TimeLimit < 0) {
|
2019-10-05 15:44:03 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_ONGOING, FrameTime);
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
int32 PrevTime = FrameTime / 1000;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
if (PrevTime != PreviousTime) {
|
|
|
|
if (PreviousTime < 12)
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_CLOCK_TICK, PrevTime);
|
|
|
|
PreviousTime = PrevTime;
|
|
|
|
}
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
} else {
|
2019-07-07 09:13:04 +02:00
|
|
|
CPopulation::m_AllRandomPedsThisType = -1;
|
|
|
|
Status = KILLFRENZY_FAILED;
|
|
|
|
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
eWeaponType fixedWeapon;
|
2019-07-07 09:13:04 +02:00
|
|
|
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
2019-10-05 15:44:03 +02:00
|
|
|
fixedWeapon = WEAPONTYPE_UZI;
|
|
|
|
else
|
|
|
|
fixedWeapon = (eWeaponType)WeaponType;
|
2019-07-07 09:13:04 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
CPlayerPed *player = FindPlayerPed();
|
|
|
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
|
|
|
player->m_nSelectedWepSlot = InterruptedWeapon;
|
|
|
|
player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal = CDarkel::AmmoInterruptedWeapon;
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
2019-07-07 09:13:04 +02:00
|
|
|
|
|
|
|
if (FindPlayerVehicle()) {
|
2019-10-05 15:44:03 +02:00
|
|
|
player->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nModelId);
|
|
|
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
|
|
|
player->MakeChangesForNewWeapon(player->m_currentWeapon);
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
if (bStandardSoundAndMessages)
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_FAILED, 0);
|
|
|
|
}
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
if (KillsNeeded <= 0) {
|
|
|
|
CPopulation::m_AllRandomPedsThisType = -1;
|
|
|
|
Status = KILLFRENZY_PASSED;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
if (bProperKillFrenzy)
|
|
|
|
CStats::AnotherKillFrenzyPassed();
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-12 18:01:22 +02:00
|
|
|
FindPlayerPed()->m_pWanted->SetWantedLevel(0);
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
eWeaponType fixedWeapon;
|
2019-07-07 09:13:04 +02:00
|
|
|
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
2019-10-05 15:44:03 +02:00
|
|
|
fixedWeapon = WEAPONTYPE_UZI;
|
|
|
|
else
|
|
|
|
fixedWeapon = (eWeaponType)WeaponType;
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-10-05 15:44:03 +02:00
|
|
|
CPlayerPed* player = FindPlayerPed();
|
|
|
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
|
|
|
player->m_nSelectedWepSlot = InterruptedWeapon;
|
|
|
|
player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal = CDarkel::AmmoInterruptedWeapon;
|
2019-07-07 09:13:04 +02:00
|
|
|
}
|
2019-07-04 22:31:21 +02:00
|
|
|
|
2019-07-07 09:13:04 +02:00
|
|
|
if (FindPlayerVehicle()) {
|
2019-10-05 15:44:03 +02:00
|
|
|
player->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nModelId);
|
|
|
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
|
|
|
player->MakeChangesForNewWeapon(player->m_currentWeapon);
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
2019-07-07 09:13:04 +02:00
|
|
|
|
|
|
|
if (bStandardSoundAndMessages)
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_PASSED, 0);
|
2019-07-04 22:31:21 +02:00
|
|
|
}
|
|
|
|
}
|