mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-27 03:24:15 +01:00
commit
9e0b23f065
@ -7,29 +7,38 @@
|
||||
#include "Timer.h"
|
||||
#include "Script.h"
|
||||
#include "OnscreenTimer.h"
|
||||
#include "Camera.h"
|
||||
|
||||
// --MIAMI: file done
|
||||
|
||||
void COnscreenTimer::Init() {
|
||||
m_bDisabled = false;
|
||||
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
|
||||
m_sEntries[i].m_nTimerOffset = 0;
|
||||
m_sEntries[i].m_nCounterOffset = 0;
|
||||
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
||||
m_sCounters[i].m_nCounterOffset = 0;
|
||||
|
||||
for(uint32 j = 0; j < 10; j++) {
|
||||
m_sEntries[i].m_aTimerText[j] = 0;
|
||||
m_sEntries[i].m_aCounterText[j] = 0;
|
||||
for(uint32 j = 0; j < ARRAY_SIZE(COnscreenCounterEntry::m_aCounterText); j++) {
|
||||
m_sCounters[i].m_aCounterText[j] = 0;
|
||||
}
|
||||
|
||||
m_sEntries[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
||||
m_sEntries[i].m_bTimerProcessed = false;
|
||||
m_sEntries[i].m_bCounterProcessed = false;
|
||||
m_sEntries[i].m_bTimerGoingDown = true;
|
||||
m_sCounters[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
||||
m_sCounters[i].m_bCounterProcessed = false;
|
||||
}
|
||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||
m_sClocks[i].m_nClockOffset = 0;
|
||||
|
||||
for(uint32 j = 0; j < ARRAY_SIZE(COnscreenTimerEntry::m_aClockText); j++) {
|
||||
m_sClocks[i].m_aClockText[j] = 0;
|
||||
}
|
||||
|
||||
m_sClocks[i].m_bClockProcessed = false;
|
||||
m_sClocks[i].m_bClockGoingDown = true;
|
||||
}
|
||||
}
|
||||
|
||||
void COnscreenTimer::Process() {
|
||||
if(!CReplay::IsPlayingBack() && !m_bDisabled) {
|
||||
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
|
||||
m_sEntries[i].Process();
|
||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||
m_sClocks[i].Process();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -37,8 +46,19 @@ void COnscreenTimer::Process() {
|
||||
void COnscreenTimer::ProcessForDisplay() {
|
||||
if(CHud::m_Wants_To_Draw_Hud) {
|
||||
m_bProcessed = false;
|
||||
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
|
||||
if(m_sEntries[i].ProcessForDisplay()) {
|
||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||
m_sClocks[i].m_bClockProcessed = false;
|
||||
if (m_sClocks[i].m_nClockOffset != 0) {
|
||||
m_sClocks[i].ProcessForDisplayClock();
|
||||
m_sClocks[i].m_bClockProcessed = true;
|
||||
m_bProcessed = true;
|
||||
}
|
||||
}
|
||||
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
||||
m_sCounters[i].m_bCounterProcessed = false;
|
||||
if (m_sCounters[i].m_nCounterOffset != 0) {
|
||||
m_sCounters[i].ProcessForDisplayCounter();
|
||||
m_sCounters[i].m_bCounterProcessed = true;
|
||||
m_bProcessed = true;
|
||||
}
|
||||
}
|
||||
@ -46,77 +66,81 @@ void COnscreenTimer::ProcessForDisplay() {
|
||||
}
|
||||
|
||||
void COnscreenTimer::ClearCounter(uint32 offset) {
|
||||
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
|
||||
if(offset == m_sEntries[i].m_nCounterOffset) {
|
||||
m_sEntries[i].m_nCounterOffset = 0;
|
||||
m_sEntries[i].m_aCounterText[0] = 0;
|
||||
m_sEntries[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
||||
m_sEntries[i].m_bCounterProcessed = 0;
|
||||
for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) {
|
||||
if(offset == m_sCounters[i].m_nCounterOffset) {
|
||||
m_sCounters[i].m_nCounterOffset = 0;
|
||||
m_sCounters[i].m_aCounterText[0] = 0;
|
||||
m_sCounters[i].m_nType = COUNTER_DISPLAY_NUMBER;
|
||||
m_sCounters[i].m_bCounterProcessed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void COnscreenTimer::ClearClock(uint32 offset) {
|
||||
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
|
||||
if(offset == m_sEntries[i].m_nTimerOffset) {
|
||||
m_sEntries[i].m_nTimerOffset = 0;
|
||||
m_sEntries[i].m_aTimerText[0] = 0;
|
||||
m_sEntries[i].m_bTimerProcessed = 0;
|
||||
for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||
if(offset == m_sClocks[i].m_nClockOffset) {
|
||||
m_sClocks[i].m_nClockOffset = 0;
|
||||
m_sClocks[i].m_aClockText[0] = 0;
|
||||
m_sClocks[i].m_bClockProcessed = 0;
|
||||
m_sClocks[i].m_bClockGoingDown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void COnscreenTimer::AddCounter(uint32 offset, uint16 type, char* text, uint16 pos) {
|
||||
|
||||
m_sEntries[pos].m_nCounterOffset = offset;
|
||||
if (m_sEntries[pos].m_aCounterText[0] != '\0')
|
||||
if (m_sCounters[pos].m_aCounterText[0] != '\0')
|
||||
return;
|
||||
|
||||
m_sCounters[pos].m_nCounterOffset = offset;
|
||||
if(text) {
|
||||
strncpy(m_sEntries[pos].m_aCounterText, text, 10);
|
||||
strncpy(m_sCounters[pos].m_aCounterText, text, ARRAY_SIZE(COnscreenCounterEntry::m_aCounterText));
|
||||
} else {
|
||||
m_sEntries[pos].m_aCounterText[0] = 0;
|
||||
m_sCounters[pos].m_aCounterText[0] = 0;
|
||||
}
|
||||
|
||||
m_sEntries[pos].m_nType = type;
|
||||
m_sCounters[pos].m_nType = type;
|
||||
}
|
||||
|
||||
void COnscreenTimer::AddClock(uint32 offset, char* text, bool bGoingDown) {
|
||||
uint32 i = 0;
|
||||
for(uint32 i = 0; i < NUMONSCREENTIMERENTRIES; i++) {
|
||||
if(m_sEntries[i].m_nTimerOffset == 0) {
|
||||
|
||||
// dead code in here
|
||||
uint32 i;
|
||||
for(i = 0; i < NUMONSCREENCLOCKS; i++) {
|
||||
if(m_sClocks[i].m_nClockOffset == 0) {
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
m_sEntries[i].m_nTimerOffset = offset;
|
||||
m_sEntries[i].m_bTimerGoingDown = bGoingDown;
|
||||
m_sClocks[i].m_nClockOffset = offset;
|
||||
m_sClocks[i].m_bClockGoingDown = bGoingDown;
|
||||
if(text) {
|
||||
strncpy(m_sEntries[i].m_aTimerText, text, 10);
|
||||
strncpy(m_sClocks[i].m_aClockText, text, ARRAY_SIZE(COnscreenTimerEntry::m_aClockText));
|
||||
} else {
|
||||
m_sEntries[i].m_aTimerText[0] = 0;
|
||||
m_sClocks[i].m_aClockText[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void COnscreenTimerEntry::Process() {
|
||||
if(m_nTimerOffset == 0) {
|
||||
if(m_nClockOffset == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32* timerPtr = CTheScripts::GetPointerToScriptVariable(m_nTimerOffset);
|
||||
int32* timerPtr = CTheScripts::GetPointerToScriptVariable(m_nClockOffset);
|
||||
int32 oldTime = *timerPtr;
|
||||
if (m_bTimerGoingDown) {
|
||||
if (m_bClockGoingDown) {
|
||||
int32 newTime = oldTime - int32(CTimer::GetTimeStepInMilliseconds());
|
||||
*timerPtr = newTime;
|
||||
if (newTime < 0) {
|
||||
*timerPtr = 0;
|
||||
m_bTimerProcessed = 0;
|
||||
m_nTimerOffset = 0;
|
||||
m_aTimerText[0] = 0;
|
||||
m_bClockProcessed = 0;
|
||||
m_nClockOffset = 0;
|
||||
m_aClockText[0] = 0;
|
||||
}
|
||||
else {
|
||||
*timerPtr = newTime;
|
||||
int32 oldTimeSeconds = oldTime / 1000;
|
||||
if (oldTimeSeconds < 12 && newTime / 1000 != oldTimeSeconds) {
|
||||
if (oldTimeSeconds < 12 && newTime / 1000 != oldTimeSeconds && !TheCamera.m_WideScreenOn) {
|
||||
DMAudio.PlayFrontEndSound(SOUND_CLOCK_TICK, newTime / 1000);
|
||||
}
|
||||
}
|
||||
@ -125,33 +149,13 @@ void COnscreenTimerEntry::Process() {
|
||||
*timerPtr = oldTime + int32(CTimer::GetTimeStepInMilliseconds());
|
||||
}
|
||||
|
||||
bool COnscreenTimerEntry::ProcessForDisplay() {
|
||||
m_bTimerProcessed = false;
|
||||
m_bCounterProcessed = false;
|
||||
|
||||
if(m_nTimerOffset == 0 && m_nCounterOffset == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(m_nTimerOffset != 0) {
|
||||
m_bTimerProcessed = true;
|
||||
ProcessForDisplayClock();
|
||||
}
|
||||
|
||||
if(m_nCounterOffset != 0) {
|
||||
m_bCounterProcessed = true;
|
||||
ProcessForDisplayCounter();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void COnscreenTimerEntry::ProcessForDisplayClock() {
|
||||
uint32 time = *CTheScripts::GetPointerToScriptVariable(m_nTimerOffset);
|
||||
sprintf(m_bTimerBuffer, "%02d:%02d", time / 1000 / 60,
|
||||
uint32 time = *CTheScripts::GetPointerToScriptVariable(m_nClockOffset);
|
||||
sprintf(m_aClockBuffer, "%02d:%02d", time / 1000 / 60 % 100,
|
||||
time / 1000 % 60);
|
||||
}
|
||||
|
||||
void COnscreenTimerEntry::ProcessForDisplayCounter() {
|
||||
void COnscreenCounterEntry::ProcessForDisplayCounter() {
|
||||
uint32 counter = *CTheScripts::GetPointerToScriptVariable(m_nCounterOffset);
|
||||
sprintf(m_bCounterBuffer, "%d", counter);
|
||||
sprintf(m_aCounterBuffer, "%d", counter);
|
||||
}
|
||||
|
@ -9,30 +9,37 @@ enum
|
||||
class COnscreenTimerEntry
|
||||
{
|
||||
public:
|
||||
uint32 m_nTimerOffset;
|
||||
uint32 m_nCounterOffset;
|
||||
char m_aTimerText[10];
|
||||
char m_aCounterText[10];
|
||||
uint16 m_nType;
|
||||
char m_bCounterBuffer[42];
|
||||
char m_bTimerBuffer[42];
|
||||
bool m_bTimerProcessed;
|
||||
bool m_bTimerGoingDown;
|
||||
bool m_bCounterProcessed;
|
||||
uint32 m_nClockOffset;
|
||||
char m_aClockText[10];
|
||||
char m_aClockBuffer[40];
|
||||
bool m_bClockProcessed;
|
||||
bool m_bClockGoingDown;
|
||||
|
||||
void Process();
|
||||
bool ProcessForDisplay();
|
||||
|
||||
void ProcessForDisplayClock();
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(COnscreenTimerEntry, 0x3C);
|
||||
|
||||
class COnscreenCounterEntry
|
||||
{
|
||||
public:
|
||||
uint32 m_nCounterOffset;
|
||||
char m_aCounterText[10];
|
||||
uint16 m_nType;
|
||||
char m_aCounterBuffer[40];
|
||||
bool m_bCounterProcessed;
|
||||
|
||||
void ProcessForDisplayCounter();
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(COnscreenTimerEntry, 0x74);
|
||||
VALIDATE_SIZE(COnscreenCounterEntry, 0x3C);
|
||||
|
||||
class COnscreenTimer
|
||||
{
|
||||
public:
|
||||
COnscreenTimerEntry m_sEntries[NUMONSCREENTIMERENTRIES];
|
||||
COnscreenTimerEntry m_sClocks[NUMONSCREENCLOCKS];
|
||||
COnscreenCounterEntry m_sCounters[NUMONSCREENCOUNTERS];
|
||||
bool m_bProcessed;
|
||||
bool m_bDisabled;
|
||||
|
||||
@ -47,4 +54,4 @@ public:
|
||||
void AddClock(uint32 offset, char* text, bool bGoingDown);
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(COnscreenTimer, 0x78);
|
||||
VALIDATE_SIZE(COnscreenTimer, 0xF4);
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include "Ped.h"
|
||||
#include "Fire.h"
|
||||
#include "GameLogic.h"
|
||||
#include "CarAI.h"
|
||||
|
||||
// --MIAMI: file done
|
||||
|
||||
CFireManager gFireManager;
|
||||
|
||||
@ -26,14 +29,13 @@ CFire::CFire()
|
||||
m_bPropagationFlag = true;
|
||||
m_bAudioSet = true;
|
||||
m_vecPos = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_pEntity = nil;
|
||||
m_pSource = nil;
|
||||
m_nFiremenPuttingOut = 0;
|
||||
m_nExtinguishTime = 0;
|
||||
m_nStartTime = 0;
|
||||
field_20 = 1;
|
||||
m_nNextTimeToAddFlames = 0;
|
||||
m_pEntity = nil;
|
||||
m_pSource = nil;
|
||||
m_fStrength = 0.8f;
|
||||
m_fWaterExtinguishCountdown = 1.0f;
|
||||
m_bExtinguishedWithWater = false;
|
||||
}
|
||||
|
||||
CFire::~CFire() {}
|
||||
@ -52,6 +54,8 @@ CFire::ProcessFire(void)
|
||||
CPed *ped = (CPed *)m_pEntity;
|
||||
CVehicle *veh = (CVehicle*)m_pEntity;
|
||||
|
||||
m_fWaterExtinguishCountdown = Min(1.0f, 0.002f * CTimer::GetTimeStep() + m_fWaterExtinguishCountdown);
|
||||
|
||||
if (m_pEntity) {
|
||||
m_vecPos = m_pEntity->GetPosition();
|
||||
|
||||
@ -109,7 +113,7 @@ CFire::ProcessFire(void)
|
||||
gFireManager.StartFire(FindPlayerPed(), m_pSource, 0.8f, 1);
|
||||
}
|
||||
if (CTimer::GetTimeInMilliseconds() > m_nNextTimeToAddFlames) {
|
||||
m_nNextTimeToAddFlames = CTimer::GetTimeInMilliseconds() + 80;
|
||||
m_nNextTimeToAddFlames = CTimer::GetTimeInMilliseconds() + (m_fWaterExtinguishCountdown < 0.3f ? 400 : (m_fWaterExtinguishCountdown < 0.7f ? 200 : 80));
|
||||
firePos = m_vecPos;
|
||||
|
||||
if (veh && veh->IsVehicle() && veh->IsCar()) {
|
||||
@ -170,11 +174,23 @@ CFire::Extinguish(void)
|
||||
|
||||
m_nExtinguishTime = 0;
|
||||
m_bIsOngoing = false;
|
||||
m_bExtinguishedWithWater = false;
|
||||
|
||||
if (m_pEntity) {
|
||||
if (m_pEntity->IsPed()) {
|
||||
((CPed *)m_pEntity)->RestorePreviousState();
|
||||
((CPed *)m_pEntity)->m_pFire = nil;
|
||||
CPed *ped = (CPed*)m_pEntity;
|
||||
if (ped->CanSetPedState()) {
|
||||
if (ped->m_nPedState != PED_DRIVING && ped->m_nPedState != PED_FALL) {
|
||||
if (ped->IsPlayer()) {
|
||||
ped->SetIdle();
|
||||
} else {
|
||||
ped->m_nLastPedState = PED_NONE;
|
||||
ped->SetWanderPath(0);
|
||||
ped->SetWaitState(WAITSTATE_FINISH_FLEE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
ped->m_pFire = nil;
|
||||
} else if (m_pEntity->IsVehicle()) {
|
||||
((CVehicle *)m_pEntity)->m_pCarFire = nil;
|
||||
}
|
||||
@ -184,7 +200,7 @@ CFire::Extinguish(void)
|
||||
}
|
||||
|
||||
void
|
||||
CFireManager::StartFire(CVector pos, float size, bool propagation)
|
||||
CFireManager::StartFire(CVector pos, float size, uint8 propagation)
|
||||
{
|
||||
CFire *fire = GetNextFreeFire();
|
||||
|
||||
@ -201,11 +217,12 @@ CFireManager::StartFire(CVector pos, float size, bool propagation)
|
||||
fire->m_nNextTimeToAddFlames = 0;
|
||||
fire->ReportThisFire();
|
||||
fire->m_fStrength = size;
|
||||
fire->m_bExtinguishedWithWater = false;
|
||||
}
|
||||
}
|
||||
|
||||
CFire *
|
||||
CFireManager::StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength, bool propagation)
|
||||
CFireManager::StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength, uint8 propagation)
|
||||
{
|
||||
CPed *ped = (CPed *)entityOnFire;
|
||||
CVehicle *veh = (CVehicle *)entityOnFire;
|
||||
@ -234,10 +251,11 @@ CFireManager::StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength
|
||||
ped->SetFlee(pos, 10000);
|
||||
ped->m_fleeFrom = nil;
|
||||
}
|
||||
ped->m_fleeTimer = CTimer::GetTimeInMilliseconds() + 10000;
|
||||
ped->bDrawLast = false;
|
||||
ped->SetMoveState(PEDMOVE_SPRINT);
|
||||
ped->SetMoveAnim();
|
||||
ped->m_nPedState = PED_ON_FIRE;
|
||||
ped->SetPedState(PED_ON_FIRE);
|
||||
}
|
||||
if (fleeFrom) {
|
||||
if (ped->m_nPedType == PEDTYPE_COP) {
|
||||
@ -251,6 +269,9 @@ CFireManager::StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength
|
||||
} else {
|
||||
if (entityOnFire->IsVehicle()) {
|
||||
veh->m_pCarFire = fire;
|
||||
if (CModelInfo::IsBikeModel(veh->GetModelIndex()) || CModelInfo::IsCarModel(veh->GetModelIndex()))
|
||||
CCarAI::TellOccupantsToFleeCar(veh);
|
||||
|
||||
if (fleeFrom) {
|
||||
CEventList::RegisterEvent(EVENT_CAR_SET_ON_FIRE, EVENT_ENTITY_VEHICLE,
|
||||
entityOnFire, (CPed *)fleeFrom, 10000);
|
||||
@ -259,6 +280,7 @@ CFireManager::StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength
|
||||
}
|
||||
|
||||
fire->m_bIsOngoing = true;
|
||||
fire->m_bExtinguishedWithWater = false;
|
||||
fire->m_bIsScriptFire = false;
|
||||
fire->m_vecPos = entityOnFire->GetPosition();
|
||||
|
||||
@ -297,26 +319,23 @@ CFireManager::Update(void)
|
||||
|
||||
CFire* CFireManager::FindNearestFire(CVector vecPos, float *pDistance)
|
||||
{
|
||||
for (int i = 0; i < MAX_FIREMEN_ATTENDING; i++) {
|
||||
int fireId = -1;
|
||||
float minDistance = 999999;
|
||||
for (int j = 0; j < NUM_FIRES; j++) {
|
||||
if (!m_aFires[j].m_bIsOngoing)
|
||||
continue;
|
||||
if (m_aFires[j].m_bIsScriptFire)
|
||||
continue;
|
||||
if (m_aFires[j].m_nFiremenPuttingOut != i)
|
||||
continue;
|
||||
float distance = (m_aFires[j].m_vecPos - vecPos).Magnitude2D();
|
||||
if (distance < minDistance) {
|
||||
minDistance = distance;
|
||||
fireId = j;
|
||||
}
|
||||
int fireId = -1;
|
||||
float minDistance = 999999;
|
||||
for (int j = 0; j < NUM_FIRES; j++) {
|
||||
if (!m_aFires[j].m_bIsOngoing)
|
||||
continue;
|
||||
if (m_aFires[j].m_bIsScriptFire)
|
||||
continue;
|
||||
float distance = (m_aFires[j].m_vecPos - vecPos).Magnitude2D();
|
||||
if (distance < minDistance) {
|
||||
minDistance = distance;
|
||||
fireId = j;
|
||||
}
|
||||
*pDistance = minDistance;
|
||||
if (fireId != -1)
|
||||
return &m_aFires[fireId];
|
||||
}
|
||||
*pDistance = minDistance;
|
||||
if (fireId != -1)
|
||||
return &m_aFires[fireId];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@ -369,8 +388,39 @@ CFireManager::ExtinguishPoint(CVector point, float range)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CFireManager::ExtinguishPointWithWater(CVector point, float range)
|
||||
{
|
||||
int fireI = 0;
|
||||
for (int i = 0; i < NUM_FIRES; i++) {
|
||||
if (m_aFires[i].m_bIsOngoing) {
|
||||
if ((point - m_aFires[i].m_vecPos).MagnitudeSqr() < sq(range)) {
|
||||
fireI = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fireI == NUM_FIRES)
|
||||
return false;
|
||||
|
||||
CFire *fireToExtinguish = &m_aFires[fireI];
|
||||
fireToExtinguish->m_fWaterExtinguishCountdown -= 0.012f * CTimer::GetTimeStep();
|
||||
CVector steamPos = fireToExtinguish->m_vecPos +
|
||||
CVector((CGeneral::GetRandomNumber() - 128) * 31.f / 200.f,
|
||||
(CGeneral::GetRandomNumber() - 128) * 31.f / 200.f,
|
||||
CGeneral::GetRandomNumber() / 200.f);
|
||||
|
||||
CParticle::AddParticle(PARTICLE_STEAM_NY_SLOWMOTION, steamPos, CVector(0.f, 0.f, 0.2f), nil, 0.5f);
|
||||
CParticle::AddParticle(PARTICLE_STEAM_NY_SLOWMOTION, steamPos, CVector(0.f, 0.f, 0.1f), nil, 0.8f);
|
||||
fireToExtinguish->m_bExtinguishedWithWater = true;
|
||||
if (fireToExtinguish->m_fWaterExtinguishCountdown < 0.0f )
|
||||
fireToExtinguish->Extinguish();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int32
|
||||
CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strength, bool propagation)
|
||||
CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strength, uint8 propagation)
|
||||
{
|
||||
CFire *fire;
|
||||
CPed *ped = (CPed *)target;
|
||||
@ -397,12 +447,15 @@ CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strengt
|
||||
fire->m_vecPos = pos;
|
||||
fire->m_nStartTime = CTimer::GetTimeInMilliseconds() + 400;
|
||||
fire->m_pEntity = target;
|
||||
fire->m_bExtinguishedWithWater = false;
|
||||
|
||||
if (target)
|
||||
target->RegisterReference(&fire->m_pEntity);
|
||||
fire->m_pSource = nil;
|
||||
fire->m_nNextTimeToAddFlames = 0;
|
||||
fire->m_fStrength = strength;
|
||||
fire->m_fWaterExtinguishCountdown = 1.0f;
|
||||
|
||||
if (target) {
|
||||
if (target->IsPed()) {
|
||||
ped->m_pFire = fire;
|
||||
@ -410,7 +463,7 @@ CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strengt
|
||||
CVector2D pos = target->GetPosition();
|
||||
ped->SetFlee(pos, 10000);
|
||||
ped->SetMoveAnim();
|
||||
ped->m_nPedState = PED_ON_FIRE;
|
||||
ped->SetPedState(PED_ON_FIRE);
|
||||
}
|
||||
} else if (target->IsVehicle()) {
|
||||
veh->m_pCarFire = fire;
|
||||
@ -430,8 +483,7 @@ CFireManager::RemoveAllScriptFires(void)
|
||||
{
|
||||
for (int i = 0; i < NUM_FIRES; i++) {
|
||||
if (m_aFires[i].m_bIsScriptFire) {
|
||||
m_aFires[i].Extinguish();
|
||||
m_aFires[i].m_bIsScriptFire = false;
|
||||
RemoveScriptFire(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,10 @@ public:
|
||||
CEntity *m_pSource;
|
||||
uint32 m_nExtinguishTime;
|
||||
uint32 m_nStartTime;
|
||||
int32 field_20;
|
||||
uint32 m_nNextTimeToAddFlames;
|
||||
uint32 m_nFiremenPuttingOut;
|
||||
float m_fStrength;
|
||||
float m_fWaterExtinguishCountdown;
|
||||
bool m_bExtinguishedWithWater;
|
||||
|
||||
CFire();
|
||||
~CFire();
|
||||
@ -34,15 +34,17 @@ class CFireManager
|
||||
public:
|
||||
uint32 m_nTotalFires;
|
||||
CFire m_aFires[NUM_FIRES];
|
||||
void StartFire(CVector pos, float size, bool propagation);
|
||||
CFire *StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength, bool propagation);
|
||||
|
||||
void StartFire(CVector pos, float size, uint8 propagation);
|
||||
CFire *StartFire(CEntity *entityOnFire, CEntity *fleeFrom, float strength, uint8 propagation);
|
||||
void Update(void);
|
||||
CFire *FindFurthestFire_NeverMindFireMen(CVector coords, float minRange, float maxRange);
|
||||
CFire *FindNearestFire(CVector vecPos, float *pDistance);
|
||||
CFire *GetNextFreeFire(void);
|
||||
uint32 GetTotalActiveFires() const;
|
||||
void ExtinguishPoint(CVector point, float range);
|
||||
int32 StartScriptFire(const CVector &pos, CEntity *target, float strength, bool propagation);
|
||||
bool ExtinguishPointWithWater(CVector point, float range);
|
||||
int32 StartScriptFire(const CVector &pos, CEntity *target, float strength, uint8 propagation);
|
||||
bool IsScriptFireExtinguish(int16 index);
|
||||
void RemoveAllScriptFires(void);
|
||||
void RemoveScriptFire(int16 index);
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include "World.h"
|
||||
#include "Zones.h"
|
||||
|
||||
// --MIAMI: file done
|
||||
|
||||
CPlaceName CUserDisplay::PlaceName;
|
||||
COnscreenTimer CUserDisplay::OnscnTimer;
|
||||
CPager CUserDisplay::Pager;
|
||||
|
@ -87,7 +87,8 @@ enum Config {
|
||||
NUMMBLURSTREAKS = 4,
|
||||
NUMSKIDMARKS = 32,
|
||||
|
||||
NUMONSCREENTIMERENTRIES = 1,
|
||||
NUMONSCREENCLOCKS = 1,
|
||||
NUMONSCREENCOUNTERS = 3,
|
||||
NUMRADARBLIPS = 75,
|
||||
NUMGENERALPICKUPS = 320,
|
||||
NUMSCRIPTEDPICKUPS = 16,
|
||||
|
@ -104,7 +104,6 @@ CEmergencyPed::FiremanAI(void)
|
||||
m_pAttendedFire = nearestFire;
|
||||
#ifdef FIX_BUGS
|
||||
bIsRunning = true;
|
||||
++nearestFire->m_nFiremenPuttingOut;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@ -116,10 +115,6 @@ CEmergencyPed::FiremanAI(void)
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
#ifdef FIX_BUGS
|
||||
bIsRunning = true;
|
||||
if (m_pAttendedFire) {
|
||||
--m_pAttendedFire->m_nFiremenPuttingOut;
|
||||
}
|
||||
++nearestFire->m_nFiremenPuttingOut;
|
||||
m_pAttendedFire = nearestFire;
|
||||
} else if (!nearestFire) {
|
||||
#else
|
||||
@ -153,10 +148,7 @@ CEmergencyPed::FiremanAI(void)
|
||||
case EMERGENCY_PED_STOP:
|
||||
#ifdef FIX_BUGS
|
||||
bIsRunning = false;
|
||||
if (m_pAttendedFire)
|
||||
#endif
|
||||
--m_pAttendedFire->m_nFiremenPuttingOut;
|
||||
|
||||
m_nPedState = PED_NONE;
|
||||
SetWanderPath(CGeneral::GetRandomNumber() & 7);
|
||||
m_pAttendedFire = nil;
|
||||
|
@ -1142,6 +1142,7 @@ CFont::ParseToken(wchar *s)
|
||||
switch(*s){
|
||||
case 'B':
|
||||
Details.bBold = !Details.bBold;
|
||||
break;
|
||||
case 'N':
|
||||
case 'n':
|
||||
NewLine = 1;
|
||||
@ -1149,7 +1150,7 @@ CFont::ParseToken(wchar *s)
|
||||
case 'b': SetColor(CRGBA(27, 89, 130, 255)); Details.anonymous_23 = true; break;
|
||||
case 'f':
|
||||
Details.bFlash = !Details.bFlash;
|
||||
if (Details.bFlash)
|
||||
if (!Details.bFlash)
|
||||
Details.color.a = 255;
|
||||
break;
|
||||
case 'g': SetColor(CRGBA(255, 150, 225, 255)); Details.anonymous_23 = true; break;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,11 @@
|
||||
#pragma once
|
||||
#include "Sprite2d.h"
|
||||
|
||||
#define HELP_MSG_LENGTH 256
|
||||
|
||||
#define HUD_TEXT_SCALE_X 0.7f
|
||||
#define HUD_TEXT_SCALE_Y 1.25f
|
||||
|
||||
enum eItems
|
||||
{
|
||||
ITEM_NONE = -1,
|
||||
@ -31,41 +36,29 @@ enum eFadeOperation
|
||||
enum eSprites
|
||||
{
|
||||
HUD_FIST,
|
||||
HUD_BAT,
|
||||
HUD_PISTOL,
|
||||
HUD_UZI,
|
||||
HUD_SHOTGUN,
|
||||
HUD_AK47,
|
||||
HUD_M16,
|
||||
HUD_SNIPER,
|
||||
HUD_ROCKET,
|
||||
HUD_FLAME,
|
||||
HUD_MOLOTOV,
|
||||
HUD_GRENADE,
|
||||
HUD_DETONATOR,
|
||||
HUD_RADARDISC = 15,
|
||||
HUD_PAGER = 16,
|
||||
HUD_SITESNIPER = 20,
|
||||
HUD_SITEROCKET = 41,
|
||||
HUD_RADARDISC = 50,
|
||||
HUD_SITESNIPER = 63,
|
||||
HUD_SITEM16,
|
||||
HUD_SITEROCKET,
|
||||
NUM_HUD_SPRITES,
|
||||
HUD_SITELASER,
|
||||
HUD_LASERDOT,
|
||||
HUD_VIEWFINDER,
|
||||
HUD_BLEEDER,
|
||||
NUM_HUD_SPRITES = 69,
|
||||
};
|
||||
|
||||
#define HUD_TEXT_SCALE_X 0.7f
|
||||
#define HUD_TEXT_SCALE_Y 1.25f
|
||||
|
||||
class CHud
|
||||
{
|
||||
public:
|
||||
static CSprite2d Sprites[NUM_HUD_SPRITES];
|
||||
static wchar m_HelpMessage[256];
|
||||
static wchar m_LastHelpMessage[256];
|
||||
static wchar m_HelpMessage[HELP_MSG_LENGTH];
|
||||
static wchar m_LastHelpMessage[HELP_MSG_LENGTH];
|
||||
static uint32 m_HelpMessageState;
|
||||
static uint32 m_HelpMessageTimer;
|
||||
static int32 m_HelpMessageFadeTimer;
|
||||
static wchar m_HelpMessageToPrint[256];
|
||||
static float &m_HelpMessageDisplayTime;
|
||||
static float m_fHelpMessageTime;
|
||||
static wchar m_HelpMessageToPrint[HELP_MSG_LENGTH];
|
||||
static float m_HelpMessageDisplayTime;
|
||||
static bool m_HelpMessageDisplayForever;
|
||||
static bool m_HelpMessageQuick;
|
||||
static uint32 m_ZoneState;
|
||||
static int32 m_ZoneFadeTimer;
|
||||
@ -86,16 +79,16 @@ public:
|
||||
static wchar m_BigMessage[6][128];
|
||||
static int16 m_ItemToFlash;
|
||||
static bool m_HideRadar;
|
||||
static int32 m_DrawClock;
|
||||
static int32 m_ClockState;
|
||||
|
||||
// These aren't really in CHud
|
||||
static float BigMessageInUse[6];
|
||||
static float BigMessageAlpha[6];
|
||||
static float BigMessageX[6];
|
||||
static float OddJob2OffTimer;
|
||||
static bool CounterOnLastFrame;
|
||||
static bool CounterOnLastFrame[NUMONSCREENCOUNTERS];
|
||||
static float OddJob2XOffset;
|
||||
static uint16 CounterFlashTimer;
|
||||
static uint16 CounterFlashTimer[NUMONSCREENCOUNTERS];
|
||||
static uint16 OddJob2Timer;
|
||||
static bool TimerOnLastFrame;
|
||||
static int16 OddJob2On;
|
||||
@ -121,6 +114,8 @@ public:
|
||||
|
||||
static uint32 m_LastDisplayScore;
|
||||
static uint32 m_LastWanted;
|
||||
static uint32 m_LastWeapon;
|
||||
static uint32 m_LastTimeEnergyLost;
|
||||
|
||||
public:
|
||||
static void Draw();
|
||||
@ -131,8 +126,8 @@ public:
|
||||
#endif
|
||||
static void Initialise();
|
||||
static void ReInitialise();
|
||||
static void SetBigMessage(wchar *message, int16 style);
|
||||
static void SetHelpMessage(wchar *message, bool quick);
|
||||
static void SetBigMessage(wchar *message, uint16 style);
|
||||
static void SetHelpMessage(wchar *message, bool quick, bool displayForever = false);
|
||||
static bool IsHelpMessageBeingDisplayed(void);
|
||||
static void SetMessage(wchar *message);
|
||||
static void SetPagerMessage(wchar *message);
|
||||
|
@ -77,9 +77,13 @@ void CWaterCannon::Update_OncePerFrame(int16 index)
|
||||
}
|
||||
}
|
||||
|
||||
int32 extinguishingPoint = CGeneral::GetRandomNumber() & (NUM_SEGMENTPOINTS - 1);
|
||||
if ( m_abUsed[extinguishingPoint] )
|
||||
gFireManager.ExtinguishPoint(m_avecPos[extinguishingPoint], 3.0f);
|
||||
for ( int32 i = 0; i < NUM_SEGMENTPOINTS; i++ )
|
||||
{
|
||||
if ( m_abUsed[i] && gFireManager.ExtinguishPointWithWater(m_avecPos[i], 4.0f) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ((index + CTimer::GetFrameCounter()) & 3) == 0 )
|
||||
PushPeds();
|
||||
|
Loading…
Reference in New Issue
Block a user