DayZ 1.24
Loading...
Searching...
No Matches
Land_Underground_WaterReservoir.c File Reference

Go to the source code of this file.

Classes

class  WaterLevelSettings
 
class  WaterLevelSnapshot
 
class  Land_Underground_WaterReservoir_Water
 

Functions

void PressureLevelSettings (int pPressureLevel, float pDuration)
 
void Land_Underground_WaterReservoir ()
 
void ~Land_Underground_WaterReservoir ()
 
override void EOnPostSimulate (IEntity other, float timeSlice)
 
override void OnVariablesSynchronized ()
 
override void SetActions ()
 
override bool HasTurnableValveBehavior ()
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
void LateInit ()
 
void ConfigureValvesAndGaugesCourse ()
 
override bool IsValveTurnable (int pValveIndex)
 
bool IsAnyValveActive ()
 
bool IsValveActive (int pValveIndex)
 
override int GetTurnableValveIndex (int pComponentIndex)
 
void OnValveManipulationStart (int pValveIndex)
 
void OnValveManipulationEnd (int pValveIndex)
 
void OnValveManipulationCanceled (int pValveIndex)
 
array< vectorGetValveAligningPointsWS (int pValveIndex)
 
void SetLastActiveValve (int pValveIndex)
 
void SetWaterLevelHeight (float pHeight)
 
void RegisterValve (string pCompName, int pIndex)
 
void TranslateMemoryPointsToWaterLevels ()
 
float WaterLevelToHeight (int pWaterLevel)
 
int HeightToWaterLevel (float pHeight)
 
float PressureLevelToValue (int pPressureLevel)
 
WaterLevelSettings PreviousWaterLevelStageSettings (int pValveIndex)
 
WaterLevelSettings ActualWaterLevelStageSettings (int pValveIndex)
 
void AdvanceToNextWaterLevelStageSettings (int pValveIndex)
 
PressureLevelSettings PreviousPressureLevelStageSettings (int pValveIndex, bool pDeanimationRequest=false)
 
PressureLevelSettings ActualPressureLevelStageSettings (int pValveIndex, bool pDeanimationRequest=false)
 
void AdvanceToNextPressureLevelStageSettings (int pValveIndex)
 
void SetDefaultPressureLevelStageSettings (int pValveIndex)
 
void AnimateValve (int pValveIndex, float pPhase)
 
void SetValvePressureLevelGauge (int pValveIndex, float pValue)
 
float GetValvePressureLevelGauge (int pValveIndex)
 
bool IsValvePressureLevelGaugeAtBase (int pValveIndex)
 
float AdjustTime (float originalTime)
 
vector GetMemoryPointPosition (string pMemoryPoint)
 
void HandleSoundEffects ()
 
void PlayValveManipulationSound ()
 
void HandleSoundEffectsPipeCreaking ()
 
void HandleSoundEffectsPipeSprinkling ()
 
void HandleSoundEffectsUnderwaterPipeSounds ()
 
void HandleSoundEffectsWaterLevelMovementSounds ()
 
void CleanSoundEffects ()
 
void PlayPipeCreakingSoundOnLocation ()
 
void HandleVisualEffects ()
 
void CleanVisualEffects ()
 
void ResetState ()
 
void SyncValveVariables ()
 
int PackArrayOfBoolStatesIntoBits (array< bool > pStates)
 
array< boolUnpackBitsToArrayOfBoolStates (int pPackedBits, int pArrayLength)
 

Variables

class WaterLevelSettings PressureLevel
 
float Duration
 
class WaterLevelSnapshot OBJECT_NAME_WATER_PLANE = "Land_Underground_WaterReservoir_Water"
 
const int WL_MIN = 0
 
const int WL_ABOVE_PIPES = 1
 
const int WL_AVERAGE = 2
 
const int WL_MAX = 3
 
const int PL_MIN = 0
 
const int PL_AVERAGE = 1
 
const int PL_MAX = 2
 
const int VALVES_COUNT = 2
 
const int VALVE_INDEX_DRAIN = 0
 
const int VALVE_INDEX_FILL = 1
 
const int PIPES_BROKEN_COUNT = 2
 
const int PIPE_INDEX_BROKEN1 = 0
 
const int PIPE_INDEX_BROKEN2 = 1
 main broken pipe
 
const string ANIM_PHASE_VALVE_GAUGE_DRAIN = "ValveGauge1"
 tighter broken pipe
 
const string ANIM_PHASE_VALVE_GAUGE_FILL = "ValveGauge2"
 
const string ANIM_PHASE_VALVE_DRAIN = "Valve1"
 
const string ANIM_PHASE_VALVE_FILL = "Valve2"
 
const string VALVE_NAME_DRAIN = "valve1"
 
const string VALVE_NAME_FILL = "valve2"
 
const string PIPE_NAME_BROKEN1 = "pipe_broken_1"
 
const string PIPE_NAME_BROKEN2 = "pipe_broken_2"
 
const string PIPE_NAME_LEAKING_DRAIN = "pipe_leaking_1"
 
const string PIPE_NAME_LEAKING_FILL = "pipe_leaking_2"
 
const string SOUND_NAME_PIPE_CREAKING = "WaterObjectUndergroundPipeCreaking_SoundSet"
 
const string SOUND_NAME_VALVE_MANIPULATION = "WaterObjectUndergroundValve_SoundSet"
 
const string SOUND_NAME_PIPE_SPRINKLING_START = "WaterObjectUndergroundPipeSprinkling_Start_SoundSet"
 
const string SOUND_NAME_PIPE_SPRINKLING_END = "WaterObjectUndergroundPipeSprinkling_End_SoundSet"
 
const string SOUND_NAME_PIPE_SPRINKLING_LOOP1 = "WaterObjectUndergroundPipeSprinkling_Loop1_SoundSet"
 
const string SOUND_NAME_PIPE_SPRINKLING_LOOP2 = "WaterObjectUndergroundPipeSprinkling_Loop2_SoundSet"
 
const string SOUND_NAME_UPIPE_SPRINKLING_START = "WaterObjectUndergroundUnderwaterPipe_Start_SoundSet"
 
const string SOUND_NAME_UPIPE_SPRINKLING_END = "WaterObjectUndergroundUnderwaterPipe_End_SoundSet"
 
const string SOUND_NAME_UPIPE_SPRINKLING_LOOP = "WaterObjectUndergroundUnderwaterPipe_Loop_SoundSet"
 
const string SOUND_NAME_WATER_FILL_LOOP = "WaterObjectUndergroundUnderwaterFill_Loop_SoundSet"
 
const string SOUND_NAME_WATER_DRAIN_LOOP = "WaterObjectUndergroundUnderwaterEmpty_Loop_SoundSet"
 
const int PARTICLE_DRAIN_PIPE_MAX_PRESSURE = ParticleList.WATER_SPILLING
 
const int PARTICLE_FILL_PIPE_MAX_PRESSURE = ParticleList.WATER_SPILLING
 
const int PARTICLE_FILL_PIPE_JET = ParticleList.WATER_JET
 
const int PARTICLE_FILL_PIPE_JET_WEAK = ParticleList.WATER_JET_WEAK
 
ref array< ref WaterLevelSettingsm_DrainValveWaterStageSettings
 valve/pipe stages for water and pressure levels
 
ref array< ref PressureLevelSettingsm_DrainValvePressureStageSettings
 
ref array< ref PressureLevelSettingsm_DrainValvePressureDeanimationSettings
 
ref array< ref WaterLevelSettingsm_FillValveWaterStageSettings
 for deanimation purposes
 
ref array< ref PressureLevelSettingsm_FillValvePressureStageSettings
 
ref array< ref PressureLevelSettingsm_FillValvePressureDeanimationSettings
 
ref WaterLevelSnapshot m_WaterLevelSnapshot
 for deanimation purposes
 
int m_DrainValveWaterLevelStageIndex
 pointing to specific stage for each valve/pipe
 
int m_DrainValvePressureLevelStageIndex
 
int m_FillValveWaterLevelStageIndex
 
int m_FillValvePressureLevelStageIndex
 
static const string WATER_LEVEL_MAX = "water_level_max"
 
static const string WATER_LEVEL_AVERAGE = "water_level_average"
 
static const string WATER_LEVEL_ABOVE_PIPES = "water_level_above_pipes"
 
static const string WATER_LEVEL_MIN = "water_level_min"
 
const int WATER_LEVELS_COUNT = 4
 
const string WATER_LEVELS [WATER_LEVELS_COUNT]
 
int m_ValveStatesPacked
 
int m_ValveStatesPackedPrev
 
int m_ValveManipulatedIndex
 
int m_ValveManipulatedIndexPrev
 
ref array< stringm_ValveNames
 
ref array< boolm_ValveStates
 
ref map< string, vectorm_WaterLevelsAvailable
 
int m_WaterLevelActual
 
int m_WaterLevelPrev
 
ref array< boolm_PressureAnimationRequests
 
ref array< boolm_PressureDeanimationRequests
 
ref array< floatm_WaterLevelTimesAccumulated
 
ref array< floatm_PressureTimesAccumulated
 
int m_LastActiveValve
 
Object m_SpawnedWaterObject
 
vector m_WaterLevelDefault
 
float m_WaterLevelHeightActual
 
bool m_ValveManipulationSoundRequested
 VFX/SFX.
 
ref EffectSound m_ValveManipulationSound
 
ref array< EffectSoundm_PipeSounds
 
bool m_PipeCreakingSoundRequested
 
ref EffectSound m_PipeCreakingSounds
 
ref EffectSound m_PipeUnderwaterSound
 
ref EffectSound m_WaterLevelMovementSound
 
const int PIPE_CREAKING_MIN_TIME_DELAY_MS = 10000
 
const int PIPE_CREAKING_MAX_TIME_DELAY_MS = 15000
 
const int PIPE_CREAKING_SOUND_LOCATIONS_COUNT = 4
 
const string PIPE_CREAKING_SOUND_LOCATIONS [PIPE_CREAKING_SOUND_LOCATIONS_COUNT]
 
ref ParticleSourceArray m_ValveParticles
 
ref ParticleSourceArray m_PipeBrokenParticles
 

Function Documentation

◆ ActualPressureLevelStageSettings()

PressureLevelSettings ActualPressureLevelStageSettings ( int pValveIndex,
bool pDeanimationRequest = false )
protected

Definition at line 728 of file Land_Underground_WaterReservoir.c.

729 {
731
732 switch (pValveIndex)
733 {
736 {
738 return plStageSettings;
739 }
740
742 break;
743 case VALVE_INDEX_FILL:
745 {
747 return plStageSettings;
748 }
749
751 break;
752 }
753
754 return plStageSettings;
755 }
ref array< ref PressureLevelSettings > m_DrainValvePressureDeanimationSettings
ref array< ref PressureLevelSettings > m_FillValvePressureStageSettings
ref array< ref PressureLevelSettings > m_FillValvePressureDeanimationSettings
int m_DrainValvePressureLevelStageIndex
ref array< ref PressureLevelSettings > m_DrainValvePressureStageSettings
const int VALVE_INDEX_DRAIN
const int VALVE_INDEX_FILL
int m_FillValvePressureLevelStageIndex
void PressureLevelSettings(int pPressureLevel, float pDuration)

References m_DrainValvePressureDeanimationSettings, m_DrainValvePressureLevelStageIndex, m_DrainValvePressureStageSettings, m_FillValvePressureDeanimationSettings, m_FillValvePressureLevelStageIndex, m_FillValvePressureStageSettings, PressureLevelSettings(), VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by EOnPostSimulate().

◆ ActualWaterLevelStageSettings()

WaterLevelSettings ActualWaterLevelStageSettings ( int pValveIndex)
protected

Definition at line 657 of file Land_Underground_WaterReservoir.c.

658 {
660
661 switch (pValveIndex)
662 {
665 break;
666 case VALVE_INDEX_FILL:
668 break;
669 }
670
671 return wlStageSettings;
672 }
ref array< ref WaterLevelSettings > m_DrainValveWaterStageSettings
valve/pipe stages for water and pressure levels
ref array< ref WaterLevelSettings > m_FillValveWaterStageSettings
for deanimation purposes
int m_DrainValveWaterLevelStageIndex
pointing to specific stage for each valve/pipe
int m_FillValveWaterLevelStageIndex

References m_DrainValveWaterLevelStageIndex, m_DrainValveWaterStageSettings, m_FillValveWaterLevelStageIndex, m_FillValveWaterStageSettings, VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by EOnPostSimulate().

◆ AdjustTime()

float AdjustTime ( float originalTime)
protected

Definition at line 845 of file Land_Underground_WaterReservoir.c.

846 {
847#ifdef DIAG_DEVELOPER
848 float timeAccel = 1;
849 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_RESERVOIR))
850 {
851 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
852 return originalTime * timeAccel;
853 }
854#endif
855 return originalTime;
856 }

Referenced by EOnPostSimulate(), and OnDoorStateChangedServer().

◆ AdvanceToNextPressureLevelStageSettings()

◆ AdvanceToNextWaterLevelStageSettings()

◆ AnimateValve()

void AnimateValve ( int pValveIndex,
float pPhase )
protected

Definition at line 789 of file Land_Underground_WaterReservoir.c.

790 {
791 switch (pValveIndex)
792 {
794 SetAnimationPhase(ANIM_PHASE_VALVE_DRAIN, pPhase);
795 break;
796 case VALVE_INDEX_FILL:
797 SetAnimationPhase(ANIM_PHASE_VALVE_FILL, pPhase);
798 break;
799 }
800 }
const string ANIM_PHASE_VALVE_FILL
const string ANIM_PHASE_VALVE_DRAIN

References ANIM_PHASE_VALVE_DRAIN, ANIM_PHASE_VALVE_FILL, VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by OnValveManipulationCanceled(), OnValveManipulationEnd(), and OnValveManipulationStart().

◆ CleanSoundEffects()

void CleanSoundEffects ( )
protected

Definition at line 1018 of file Land_Underground_WaterReservoir.c.

1019 {
1022 }
ref array< EffectSound > m_PipeSounds
Manager class for managing Effect (EffectParticle, EffectSound)
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.

References SEffectManager::DestroySound(), m_PipeSounds, VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by ResetState(), and ~Land_Underground_WaterReservoir().

◆ CleanVisualEffects()

void CleanVisualEffects ( )
protected

Definition at line 1101 of file Land_Underground_WaterReservoir.c.

1102 {
1103 for (int valve = 0; valve < VALVES_COUNT; ++valve)
1104 {
1106 {
1107 m_ValveParticles[valve].StopParticle();
1109 }
1110 }
1111
1112 for (int pipe = 0; pipe < m_PipeBrokenParticles.Count(); ++pipe)
1113 {
1115 {
1116 m_PipeBrokenParticles[pipe].StopParticle();
1118 }
1119 }
1120 }
ref ParticleSourceArray m_PipeBrokenParticles
ref ParticleSourceArray m_ValveParticles
const int VALVES_COUNT

References m_PipeBrokenParticles, m_ValveParticles, and VALVES_COUNT.

Referenced by ~Land_Underground_WaterReservoir().

◆ ConfigureValvesAndGaugesCourse()

void ConfigureValvesAndGaugesCourse ( )
protected

drain - water level

drain - pressure

for deanimation purposes only while valves activation overllaps

fill - water level

fill - pressure

for deanimation purposes only while valves activation overllaps

Definition at line 402 of file Land_Underground_WaterReservoir.c.

403 {
409
415
419
425
431
435 }
const int WL_AVERAGE
const int PL_AVERAGE

References m_DrainValvePressureDeanimationSettings, m_DrainValvePressureStageSettings, m_DrainValveWaterStageSettings, m_FillValvePressureDeanimationSettings, m_FillValvePressureStageSettings, m_FillValveWaterStageSettings, PL_AVERAGE, PL_MAX, PL_MIN, PressureLevelSettings(), WL_AVERAGE, WL_MAX, and WL_MIN.

Referenced by LateInit().

◆ EOnPostSimulate()

override void EOnPostSimulate ( IEntity other,
float timeSlice )
protected

In case where one of the valves is already running

  • snapshot values; stop animation of that valve and continue with newly requested

will force that valve to start deanimation of gauge

water level course and animation

stay on the same level

pressure course and animation

stay on the same level

end of deanimation - overlapped activation of valves

Definition at line 166 of file Land_Underground_WaterReservoir.c.

167 {
168#ifndef SERVER
171#endif
172
173 if (!GetGame().IsServer())
174 return;
175
176 int valve;
180
183 for (valve = 0; valve < VALVES_COUNT; ++valve)
184 {
186 {
191 m_ValveStates[valve] = false;
193 break;
194 }
195 }
196
198 for (valve = 0; valve < VALVES_COUNT; ++valve)
199 {
200 if (m_ValveStates[valve] == true)
201 {
204
206 if (wlStageSettings.Duration == -1.0)
207 {
208 m_ValveStates[valve] = false;
212 return;
213 }
214
216 float adjustedDuration = wlStageSettings.Duration;
218 {
220 adjustedDuration = wlStageSettings.Duration + m_WaterLevelSnapshot.RemainingDuration;
221 }
222
224 {
226 float target = WaterLevelToHeight(wlStageSettings.WaterLevel);
229 }
230 else
231 {
235 SetSynchDirty();
236 }
237
239 }
240 else
241 {
244 }
245 }
246
247 int allValvesStates = 0;
248
250 for (valve = 0; valve < VALVES_COUNT; ++valve)
251 {
253 {
257
259 if (plStageSettings.Duration == -1.0)
260 {
264 return;
265 }
266
268 {
269 float plStart = PressureLevelToValue(plStageSettingsPrev.PressureLevel);
270 float plTarget = PressureLevelToValue(plStageSettings.PressureLevel);
273 }
274 else
275 {
279 {
282 }
283 else
284 {
286 SetSynchDirty();
287 }
288 }
289
291 }
292 else
294
295
297 if (allValvesStates == false)
299 }
300 }
float m_WaterLevelHeightActual
void SetDefaultPressureLevelStageSettings(int pValveIndex)
bool IsValvePressureLevelGaugeAtBase(int pValveIndex)
PressureLevelSettings ActualPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
ref array< bool > m_PressureDeanimationRequests
WaterLevelSettings ActualWaterLevelStageSettings(int pValveIndex)
void AdvanceToNextPressureLevelStageSettings(int pValveIndex)
PressureLevelSettings PreviousPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
void SetWaterLevelHeight(float pHeight)
ref array< bool > m_ValveStates
void SetValvePressureLevelGauge(int pValveIndex, float pValue)
float WaterLevelToHeight(int pWaterLevel)
ref array< float > m_PressureTimesAccumulated
WaterLevelSettings PreviousWaterLevelStageSettings(int pValveIndex)
void AdvanceToNextWaterLevelStageSettings(int pValveIndex)
float PressureLevelToValue(int pPressureLevel)
ref WaterLevelSnapshot m_WaterLevelSnapshot
for deanimation purposes
float AdjustTime(float originalTime)
ref array< float > m_WaterLevelTimesAccumulated
ref array< bool > m_PressureAnimationRequests
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition Easing.c:3
static float EaseInOutSine(float t)
Definition Easing.c:14
Definition EnMath.c:7
const int INDEX_NOT_FOUND
Definition gameplay.c:13
proto native CGame GetGame()
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

References ActualPressureLevelStageSettings(), ActualWaterLevelStageSettings(), AdjustTime(), AdvanceToNextPressureLevelStageSettings(), AdvanceToNextWaterLevelStageSettings(), Math::Clamp(), Easing::EaseInOutSine(), GetGame(), HandleSoundEffects(), HandleVisualEffects(), INDEX_NOT_FOUND, IsValvePressureLevelGaugeAtBase(), Math::Lerp(), m_LastActiveValve, m_PressureAnimationRequests, m_PressureDeanimationRequests, m_PressureTimesAccumulated, m_ValveStates, m_WaterLevelHeightActual, m_WaterLevelSnapshot, m_WaterLevelTimesAccumulated, PressureLevelSettings(), PressureLevelToValue(), PreviousPressureLevelStageSettings(), PreviousWaterLevelStageSettings(), SetDefaultPressureLevelStageSettings(), SetValvePressureLevelGauge(), SetWaterLevelHeight(), SyncValveVariables(), VALVES_COUNT, and WaterLevelToHeight().

◆ GetMemoryPointPosition()

vector GetMemoryPointPosition ( string pMemoryPoint)
protected

Definition at line 858 of file Land_Underground_WaterReservoir.c.

859 {
860 vector pos = vector.Zero;
861
862 if (MemoryPointExists(pMemoryPoint))
863 {
864 pos = GetMemoryPointPos(pMemoryPoint);
865 pos = ModelToWorld(pos);
866 }
867 else
868 ErrorEx(string.Format("Memory point %1 not found, falling back to vector.Zero", pMemoryPoint));
869
870 return pos;
871 }
static const vector Zero
Definition EnConvert.c:110
enum ShapeType ErrorEx

References ErrorEx, and vector::Zero.

Referenced by GetValveAligningPointsWS(), and HandleVisualEffects().

◆ GetTurnableValveIndex()

override int GetTurnableValveIndex ( int pComponentIndex)
protected

Definition at line 458 of file Land_Underground_WaterReservoir.c.

459 {
460 string targetedValveName = GetActionComponentName(pComponentIndex);
461 for (int i = 0; i < m_ValveNames.Count(); ++i)
462 {
464 return i;
465 }
466
467 return INDEX_NOT_FOUND;
468 }
ref array< string > m_ValveNames

References INDEX_NOT_FOUND, and m_ValveNames.

◆ GetValveAligningPointsWS()

array< vector > GetValveAligningPointsWS ( int pValveIndex)
protected

for the animation aligning returns data in order: start point; direction point

Definition at line 520 of file Land_Underground_WaterReservoir.c.

521 {
523
524 switch (pValveIndex)
525 {
527 posPoint = GetMemoryPointPosition(string.Format("%1_align_pos", VALVE_NAME_DRAIN));
528 dirPoint = GetMemoryPointPosition(string.Format("%1_align_dir", VALVE_NAME_DRAIN));
529 break;
530 case VALVE_INDEX_FILL:
531 posPoint = GetMemoryPointPosition(string.Format("%1_align_pos", VALVE_NAME_FILL));
532 dirPoint = GetMemoryPointPosition(string.Format("%1_align_dir", VALVE_NAME_FILL));
533 break;
534 }
535
537 valvePositions.Insert(posPoint);
538 valvePositions.Insert(dirPoint);
539
540 return valvePositions;
541 }
const string VALVE_NAME_FILL
const string VALVE_NAME_DRAIN
vector GetMemoryPointPosition(string pMemoryPoint)

References GetMemoryPointPosition(), VALVE_INDEX_DRAIN, VALVE_INDEX_FILL, VALVE_NAME_DRAIN, VALVE_NAME_FILL, and vector::Zero.

◆ GetValvePressureLevelGauge()

float GetValvePressureLevelGauge ( int pValveIndex)
protected

Definition at line 815 of file Land_Underground_WaterReservoir.c.

816 {
817 switch (pValveIndex)
818 {
820 return GetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_DRAIN);
821 break;
822 case VALVE_INDEX_FILL:
823 return GetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_FILL);
824 break;
825 }
826
827 return 0;
828 }
const string ANIM_PHASE_VALVE_GAUGE_FILL
const string ANIM_PHASE_VALVE_GAUGE_DRAIN
tighter broken pipe

References ANIM_PHASE_VALVE_GAUGE_DRAIN, ANIM_PHASE_VALVE_GAUGE_FILL, VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by HandleSoundEffectsPipeSprinkling(), HandleVisualEffects(), and IsValvePressureLevelGaugeAtBase().

◆ HandleSoundEffects()

◆ HandleSoundEffectsPipeCreaking()

void HandleSoundEffectsPipeCreaking ( )
protected

Definition at line 894 of file Land_Underground_WaterReservoir.c.

895 {
896 if (IsAnyValveActive())
897 {
899 {
903 }
904 }
905 else
906 {
908 {
909 StopSoundSet(m_PipeCreakingSounds);
911 }
912 }
913 }
void PlayPipeCreakingSoundOnLocation()
bool m_PipeCreakingSoundRequested
const int PIPE_CREAKING_MIN_TIME_DELAY_MS
ref EffectSound m_PipeCreakingSounds
const int PIPE_CREAKING_MAX_TIME_DELAY_MS
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, GetGame(), IsAnyValveActive(), m_PipeCreakingSoundRequested, m_PipeCreakingSounds, PIPE_CREAKING_MAX_TIME_DELAY_MS, PIPE_CREAKING_MIN_TIME_DELAY_MS, PlayPipeCreakingSoundOnLocation(), and Math::RandomInt().

Referenced by HandleSoundEffects().

◆ HandleSoundEffectsPipeSprinkling()

void HandleSoundEffectsPipeSprinkling ( )
protected

Definition at line 915 of file Land_Underground_WaterReservoir.c.

916 {
917 if (!m_PipeSounds || m_PipeSounds.Count() == 0)
918 return;
919
922 if (drainPressureLevel >= 0.4 && drainPressureLevel < 0.8)
923 {
925 {
926 PlaySoundSetAtMemoryPoint(sndDrain, SOUND_NAME_PIPE_SPRINKLING_START, VALVE_NAME_DRAIN, false, 0.0, 0.5);
928 StopSoundSet(m_PipeSounds[VALVE_INDEX_DRAIN]);
930 PlaySoundSetAtMemoryPointLooped(sndDrain, SOUND_NAME_PIPE_SPRINKLING_LOOP1, VALVE_NAME_DRAIN, 0.5, 0.5);
932 }
933 }
934
935 if (drainPressureLevel < 0.4)
936 {
938 {
939 StopSoundSet(m_PipeSounds[VALVE_INDEX_DRAIN]);
941 }
942 }
943
945
947 if (fillPressureLevel >= 0.4)
948 {
950 {
951 PlaySoundSetAtMemoryPoint(sndFill, SOUND_NAME_PIPE_SPRINKLING_START, VALVE_NAME_FILL, false, 0.0, 0.5);
952 StopSoundSet(m_PipeSounds[VALVE_INDEX_FILL]);
954 PlaySoundSetAtMemoryPointLooped(sndFill, SOUND_NAME_PIPE_SPRINKLING_LOOP2, VALVE_NAME_FILL, 0.5, 0.5);
956 }
957 }
958
959 if (fillPressureLevel < 0.4)
960 {
962 {
963 StopSoundSet(m_PipeSounds[VALVE_INDEX_FILL]);
965 }
966 }
967 }
const string SOUND_NAME_PIPE_SPRINKLING_START
const string SOUND_NAME_PIPE_SPRINKLING_LOOP2
float GetValvePressureLevelGauge(int pValveIndex)
const string SOUND_NAME_PIPE_SPRINKLING_LOOP1
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5

References GetValvePressureLevelGauge(), m_PipeSounds, SOUND_NAME_PIPE_SPRINKLING_LOOP1, SOUND_NAME_PIPE_SPRINKLING_LOOP2, SOUND_NAME_PIPE_SPRINKLING_START, VALVE_INDEX_DRAIN, VALVE_INDEX_FILL, VALVE_NAME_DRAIN, and VALVE_NAME_FILL.

Referenced by HandleSoundEffects().

◆ HandleSoundEffectsUnderwaterPipeSounds()

void HandleSoundEffectsUnderwaterPipeSounds ( )
protected

strong water jet sound only when fill valve activated

Definition at line 969 of file Land_Underground_WaterReservoir.c.

970 {
973 {
975 {
977 {
978 PlaySoundSetAtMemoryPoint(m_PipeUnderwaterSound, SOUND_NAME_UPIPE_SPRINKLING_START, PIPE_NAME_BROKEN1, false, 0.0, 0.5);
979 StopSoundSet(m_PipeUnderwaterSound);
982 }
983 }
985 {
987 {
988 StopSoundSet(m_PipeUnderwaterSound);
990 {
991 PlaySoundSetAtMemoryPoint(m_PipeUnderwaterSound, SOUND_NAME_UPIPE_SPRINKLING_END, PIPE_NAME_BROKEN1, false, 0.0, 0.5);
993 }
994 }
995 }
996 }
997 }
const string PIPE_NAME_BROKEN1
bool IsValveActive(int pValveIndex)
const string SOUND_NAME_UPIPE_SPRINKLING_START
const string SOUND_NAME_UPIPE_SPRINKLING_END
ref EffectSound m_PipeUnderwaterSound
const int WL_ABOVE_PIPES
const string SOUND_NAME_UPIPE_SPRINKLING_LOOP

References IsValveActive(), m_PipeUnderwaterSound, m_WaterLevelActual, m_WaterLevelPrev, PIPE_NAME_BROKEN1, SOUND_NAME_UPIPE_SPRINKLING_END, SOUND_NAME_UPIPE_SPRINKLING_LOOP, SOUND_NAME_UPIPE_SPRINKLING_START, VALVE_INDEX_FILL, WL_ABOVE_PIPES, WL_AVERAGE, and WL_MAX.

Referenced by HandleSoundEffects().

◆ HandleSoundEffectsWaterLevelMovementSounds()

void HandleSoundEffectsWaterLevelMovementSounds ( )
protected

Definition at line 999 of file Land_Underground_WaterReservoir.c.

1000 {
1002 {
1004 PlaySoundSetAtMemoryPointLooped(m_WaterLevelMovementSound, SOUND_NAME_WATER_DRAIN_LOOP, PIPE_NAME_BROKEN1, 0.0, 0.5);
1005 }
1007 {
1009 PlaySoundSetAtMemoryPointLooped(m_WaterLevelMovementSound, SOUND_NAME_WATER_FILL_LOOP, PIPE_NAME_BROKEN1, 0.0, 0.5);
1010 }
1012 {
1014 StopSoundSet(m_WaterLevelMovementSound);
1015 }
1016 }
const string SOUND_NAME_WATER_FILL_LOOP
ref EffectSound m_WaterLevelMovementSound
const string SOUND_NAME_WATER_DRAIN_LOOP

References m_WaterLevelActual, m_WaterLevelMovementSound, m_WaterLevelPrev, PIPE_NAME_BROKEN1, SOUND_NAME_WATER_DRAIN_LOOP, and SOUND_NAME_WATER_FILL_LOOP.

Referenced by HandleSoundEffects().

◆ HandleVisualEffects()

void HandleVisualEffects ( )
protected

strong jet stream particle only when fill valve activated

we don't need the weak jet stream

weak jet stream

Definition at line 1031 of file Land_Underground_WaterReservoir.c.

1032 {
1034 {
1037 }
1038
1040 {
1042 {
1043 m_ValveParticles[VALVE_INDEX_DRAIN].StopParticle();
1045 }
1046 }
1047
1049 {
1052 }
1053
1055 {
1057 {
1058 m_ValveParticles[VALVE_INDEX_FILL].StopParticle();
1060 }
1061 }
1062
1063
1066 {
1068 {
1071
1074 {
1077 }
1078 }
1079 }
1080
1083 {
1086 }
1087
1089 {
1090 for (int pipe = 0; pipe < m_PipeBrokenParticles.Count(); ++pipe)
1091 {
1093 {
1094 m_PipeBrokenParticles[pipe].StopParticle();
1096 }
1097 }
1098 }
1099 }
vector GetOrientation()
const int PIPE_INDEX_BROKEN1
const int PARTICLE_FILL_PIPE_JET
const int PARTICLE_FILL_PIPE_MAX_PRESSURE
const string PIPE_NAME_LEAKING_DRAIN
const int PARTICLE_DRAIN_PIPE_MAX_PRESSURE
const string PIPE_NAME_LEAKING_FILL
const int PIPE_INDEX_BROKEN2
main broken pipe
const int PARTICLE_FILL_PIPE_JET_WEAK
const string PIPE_NAME_BROKEN2
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)

References GetMemoryPointPosition(), GetOrientation(), GetValvePressureLevelGauge(), IsValveActive(), m_PipeBrokenParticles, m_ValveParticles, m_WaterLevelActual, m_WaterLevelPrev, PARTICLE_DRAIN_PIPE_MAX_PRESSURE, PARTICLE_FILL_PIPE_JET, PARTICLE_FILL_PIPE_JET_WEAK, PARTICLE_FILL_PIPE_MAX_PRESSURE, ParticleManager(), PIPE_INDEX_BROKEN1, PIPE_INDEX_BROKEN2, PIPE_NAME_BROKEN1, PIPE_NAME_BROKEN2, PIPE_NAME_LEAKING_DRAIN, PIPE_NAME_LEAKING_FILL, VALVE_INDEX_DRAIN, VALVE_INDEX_FILL, WL_ABOVE_PIPES, WL_AVERAGE, and WL_MAX.

Referenced by EOnPostSimulate().

◆ HasTurnableValveBehavior()

override bool HasTurnableValveBehavior ( )
protected

Definition at line 322 of file Land_Underground_WaterReservoir.c.

323 {
324 return true;
325 }

◆ HeightToWaterLevel()

int HeightToWaterLevel ( float pHeight)
protected

◆ Init()

void Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

Definition at line 327 of file Land_Underground_WaterReservoir.c.

328 {
343
346
350
354
356 int i = 0;
357 for (i = 0; i < VALVES_COUNT; ++i)
358 {
359 m_ValveNames.Insert("none");
360 m_ValveStates.Insert(false);
361 m_PressureAnimationRequests.Insert(false);
362 m_PressureDeanimationRequests.Insert(false);
365 m_PipeSounds.Insert(null);
366 m_ValveParticles.Insert(null);
367 }
368
369 for (i = 0; i < PIPES_BROKEN_COUNT; ++i)
371
372 RegisterNetSyncVariableInt("m_ValveStatesPacked", 0);
373 RegisterNetSyncVariableInt("m_ValveManipulatedIndex", -1, VALVES_COUNT - 1);
374 RegisterNetSyncVariableInt("m_WaterLevelActual", WL_MIN, WL_MAX);
375 RegisterNetSyncVariableInt("m_WaterLevelPrev", WL_MIN, WL_MAX);
376
377 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(LateInit, 250);
378 }
const int PIPES_BROKEN_COUNT
array< ParticleSource > ParticleSourceArray

References CALL_CATEGORY_SYSTEM, GetGame(), INDEX_NOT_FOUND, LateInit(), m_DrainValvePressureDeanimationSettings, m_DrainValvePressureStageSettings, m_DrainValveWaterStageSettings, m_FillValvePressureDeanimationSettings, m_FillValvePressureStageSettings, m_FillValveWaterStageSettings, m_LastActiveValve, m_PipeBrokenParticles, m_PipeSounds, m_PressureAnimationRequests, m_PressureDeanimationRequests, m_PressureTimesAccumulated, m_ValveManipulatedIndex, m_ValveManipulatedIndexPrev, m_ValveNames, m_ValveParticles, m_ValveStates, m_WaterLevelActual, m_WaterLevelPrev, m_WaterLevelsAvailable, m_WaterLevelSnapshot, m_WaterLevelTimesAccumulated, PIPES_BROKEN_COUNT, VALVES_COUNT, WL_AVERAGE, WL_MAX, and WL_MIN.

◆ IsAnyValveActive()

bool IsAnyValveActive ( )
protected

Definition at line 442 of file Land_Underground_WaterReservoir.c.

443 {
444 for (int i = 0; i < m_ValveStates.Count(); ++i)
445 {
446 if (m_ValveStates[i])
447 return true;
448 }
449
450 return false;
451 }

References m_ValveStates.

Referenced by HandleSoundEffectsPipeCreaking().

◆ IsValveActive()

bool IsValveActive ( int pValveIndex)
protected

◆ IsValvePressureLevelGaugeAtBase()

bool IsValvePressureLevelGaugeAtBase ( int pValveIndex)
protected

Definition at line 830 of file Land_Underground_WaterReservoir.c.

831 {
832 switch (pValveIndex)
833 {
836 break;
837 case VALVE_INDEX_FILL:
839 break;
840 }
841
842 return 0.0;
843 }

References GetValvePressureLevelGauge(), VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by EOnPostSimulate(), and IsValveTurnable().

◆ IsValveTurnable()

override bool IsValveTurnable ( int pValveIndex)
protected

◆ Land_Underground_WaterReservoir()

void Land_Underground_WaterReservoir ( )
protected

Definition at line 153 of file Land_Underground_WaterReservoir.c.

154 {
155 SetEventMask(EntityEvent.POSTSIMULATE);
156
157 Init();
158 }
void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:44

References Init().

Referenced by CreateAndSetupActionCallback(), OnEndAnimationLoop(), OnFinishProgressServer(), and OnStartAnimationLoopServer().

◆ LateInit()

void LateInit ( )
protected

Definition at line 380 of file Land_Underground_WaterReservoir.c.

381 {
384
386
388
390
391 if (GetGame().IsServer())
392 {
394 m_SpawnedWaterObject.SetOrientation(GetOrientation());
396 }
397
398 GetGame().RegisterNetworkStaticObject(this);
399 SetSynchDirty();
400 }
const int ECE_CREATEPHYSICS
void RegisterValve(string pCompName, int pIndex)
void TranslateMemoryPointsToWaterLevels()
Object m_SpawnedWaterObject
class WaterLevelSnapshot OBJECT_NAME_WATER_PLANE
void ConfigureValvesAndGaugesCourse()

References ConfigureValvesAndGaugesCourse(), ECE_CREATEPHYSICS, GetGame(), GetOrientation(), m_SpawnedWaterObject, m_WaterLevelDefault, m_WaterLevelsAvailable, OBJECT_NAME_WATER_PLANE, RegisterValve(), SetWaterLevelHeight(), TranslateMemoryPointsToWaterLevels(), VALVE_INDEX_DRAIN, VALVE_INDEX_FILL, VALVE_NAME_DRAIN, VALVE_NAME_FILL, and WATER_LEVEL_AVERAGE.

Referenced by Init().

◆ OnValveManipulationCanceled()

void OnValveManipulationCanceled ( int pValveIndex)
protected

Definition at line 508 of file Land_Underground_WaterReservoir.c.

509 {
510 if (GetGame().IsServer())
511 {
514 SetSynchDirty();
515 }
516 }
void AnimateValve(int pValveIndex, float pPhase)

References AnimateValve(), GetGame(), and m_ValveManipulatedIndex.

◆ OnValveManipulationEnd()

◆ OnValveManipulationStart()

void OnValveManipulationStart ( int pValveIndex)
protected

Definition at line 470 of file Land_Underground_WaterReservoir.c.

471 {
472 if (GetGame().IsServer())
473 {
476 SetSynchDirty();
477 }
478 }

References AnimateValve(), GetGame(), and m_ValveManipulatedIndex.

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
protected

◆ PackArrayOfBoolStatesIntoBits()

int PackArrayOfBoolStatesIntoBits ( array< bool > pStates)
protected

Definition at line 1159 of file Land_Underground_WaterReservoir.c.

1160 {
1161 int packedBits = 0;
1162
1163 for (int i = 0; i < pStates.Count(); ++i)
1164 {
1165 if (pStates[i] == true)
1166 packedBits |= 1 << i;
1167 }
1168
1169 return packedBits;
1170 }

Referenced by SyncValveVariables().

◆ PlayPipeCreakingSoundOnLocation()

void PlayPipeCreakingSoundOnLocation ( )
protected

◆ PlayValveManipulationSound()

◆ PressureLevelSettings()

void PressureLevelSettings ( int pPressureLevel,
float pDuration )

◆ PressureLevelToValue()

float PressureLevelToValue ( int pPressureLevel)
protected

Definition at line 616 of file Land_Underground_WaterReservoir.c.

617 {
618 switch (pPressureLevel)
619 {
620 case PL_MIN:
621 return 0.0;
622 case PL_AVERAGE:
623 return 0.5;
624 case PL_MAX:
625 return 1.0;
626 }
627
628 return 0.0;
629 }

References PL_AVERAGE, PL_MAX, and PL_MIN.

Referenced by EOnPostSimulate().

◆ PreviousPressureLevelStageSettings()

◆ PreviousWaterLevelStageSettings()

◆ RegisterValve()

◆ ResetState()

void ResetState ( )
protected

Definition at line 1123 of file Land_Underground_WaterReservoir.c.

References CleanSoundEffects(), m_DrainValvePressureLevelStageIndex, m_DrainValveWaterLevelStageIndex, m_FillValvePressureLevelStageIndex, m_FillValveWaterLevelStageIndex, m_LastActiveValve, m_PipeCreakingSoundRequested, m_PressureAnimationRequests, m_PressureDeanimationRequests, m_PressureTimesAccumulated, m_ValveManipulatedIndex, m_ValveManipulatedIndexPrev, m_ValveStates, m_WaterLevelHeightActual, m_WaterLevelsAvailable, m_WaterLevelTimesAccumulated, SetValvePressureLevelGauge(), SetWaterLevelHeight(), VALVE_INDEX_DRAIN, VALVE_INDEX_FILL, WATER_LEVEL_AVERAGE, WaterLevelToHeight(), and WL_AVERAGE.

◆ SetActions()

override void SetActions ( )
protected

Definition at line 315 of file Land_Underground_WaterReservoir.c.

316 {
317 super.SetActions();
318
320 }
ActionTurnValveUndergroundReservoirCB ActionTurnValveCB ActionTurnValveUndergroundReservoir()
void AddAction(typename actionName)

References ActionTurnValveUndergroundReservoir(), and AddAction().

◆ SetDefaultPressureLevelStageSettings()

void SetDefaultPressureLevelStageSettings ( int pValveIndex)
protected

◆ SetLastActiveValve()

void SetLastActiveValve ( int pValveIndex)
protected

Definition at line 543 of file Land_Underground_WaterReservoir.c.

544 {
546 }

References m_LastActiveValve.

Referenced by OnValveManipulationEnd().

◆ SetValvePressureLevelGauge()

void SetValvePressureLevelGauge ( int pValveIndex,
float pValue )
protected

Definition at line 802 of file Land_Underground_WaterReservoir.c.

803 {
804 switch (pValveIndex)
805 {
807 SetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_DRAIN, pValue);
808 break;
809 case VALVE_INDEX_FILL:
810 SetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_FILL, pValue);
811 break;
812 }
813 }

References ANIM_PHASE_VALVE_GAUGE_DRAIN, ANIM_PHASE_VALVE_GAUGE_FILL, VALVE_INDEX_DRAIN, and VALVE_INDEX_FILL.

Referenced by EOnPostSimulate(), and ResetState().

◆ SetWaterLevelHeight()

void SetWaterLevelHeight ( float pHeight)
protected

Definition at line 548 of file Land_Underground_WaterReservoir.c.

549 {
550 if (GetGame() && GetGame().IsServer())
551 {
555
557 m_SpawnedWaterObject.SetPosition(pos);
558 }
559 }
int HeightToWaterLevel(float pHeight)
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References GetGame(), HeightToWaterLevel(), m_SpawnedWaterObject, m_WaterLevelActual, m_WaterLevelDefault, m_WaterLevelHeightActual, and Vector().

Referenced by EOnPostSimulate(), LateInit(), and ResetState().

◆ SyncValveVariables()

void SyncValveVariables ( )
protected

◆ TranslateMemoryPointsToWaterLevels()

void TranslateMemoryPointsToWaterLevels ( )
protected

Definition at line 572 of file Land_Underground_WaterReservoir.c.

573 {
575 for (int i = 0; i < WATER_LEVELS_COUNT; ++i)
576 {
577 if (MemoryPointExists(WATER_LEVELS[i]))
578 {
579 if (!m_WaterLevelsAvailable.Contains(WATER_LEVELS[i]))
580 m_WaterLevelsAvailable.Insert(WATER_LEVELS[i], ModelToWorld(GetMemoryPointPos(WATER_LEVELS[i])));
581 }
582 }
583 }
const string WATER_LEVELS[WATER_LEVELS_COUNT]
const int WATER_LEVELS_COUNT

References m_WaterLevelsAvailable, WATER_LEVELS, and WATER_LEVELS_COUNT.

Referenced by LateInit().

◆ UnpackBitsToArrayOfBoolStates()

array< bool > UnpackBitsToArrayOfBoolStates ( int pPackedBits,
int pArrayLength )
protected

Definition at line 1172 of file Land_Underground_WaterReservoir.c.

1173 {
1175 for (int i = 0; i < pArrayLength; ++i)
1176 {
1177 if ((pPackedBits & 1 << i) != 0)
1178 unpackedBools.Insert(true);
1179 else
1180 unpackedBools.Insert(false);
1181 }
1182
1183 return unpackedBools;
1184 }

Referenced by OnVariablesSynchronized().

◆ WaterLevelToHeight()

float WaterLevelToHeight ( int pWaterLevel)
protected

◆ ~Land_Underground_WaterReservoir()

Variable Documentation

◆ ANIM_PHASE_VALVE_DRAIN

const string ANIM_PHASE_VALVE_DRAIN = "Valve1"
protected

Definition at line 54 of file Land_Underground_WaterReservoir.c.

Referenced by AnimateValve().

◆ ANIM_PHASE_VALVE_FILL

const string ANIM_PHASE_VALVE_FILL = "Valve2"
protected

Definition at line 55 of file Land_Underground_WaterReservoir.c.

Referenced by AnimateValve().

◆ ANIM_PHASE_VALVE_GAUGE_DRAIN

const string ANIM_PHASE_VALVE_GAUGE_DRAIN = "ValveGauge1"
protected

tighter broken pipe

Definition at line 52 of file Land_Underground_WaterReservoir.c.

Referenced by GetValvePressureLevelGauge(), and SetValvePressureLevelGauge().

◆ ANIM_PHASE_VALVE_GAUGE_FILL

const string ANIM_PHASE_VALVE_GAUGE_FILL = "ValveGauge2"
protected

◆ Duration

float Duration

Definition at line 16 of file Land_Underground_WaterReservoir.c.

Referenced by PressureLevelSettings().

◆ m_DrainValvePressureDeanimationSettings

ref array<ref PressureLevelSettings> m_DrainValvePressureDeanimationSettings
protected

◆ m_DrainValvePressureLevelStageIndex

◆ m_DrainValvePressureStageSettings

◆ m_DrainValveWaterLevelStageIndex

int m_DrainValveWaterLevelStageIndex
protected

◆ m_DrainValveWaterStageSettings

ref array<ref WaterLevelSettings> m_DrainValveWaterStageSettings
protected

◆ m_FillValvePressureDeanimationSettings

◆ m_FillValvePressureLevelStageIndex

◆ m_FillValvePressureStageSettings

◆ m_FillValveWaterLevelStageIndex

◆ m_FillValveWaterStageSettings

◆ m_LastActiveValve

int m_LastActiveValve
protected

◆ m_PipeBrokenParticles

ref ParticleSourceArray m_PipeBrokenParticles
protected

◆ m_PipeCreakingSoundRequested

bool m_PipeCreakingSoundRequested
protected

◆ m_PipeCreakingSounds

ref EffectSound m_PipeCreakingSounds
protected

◆ m_PipeSounds

◆ m_PipeUnderwaterSound

ref EffectSound m_PipeUnderwaterSound
protected

◆ m_PressureAnimationRequests

ref array<bool> m_PressureAnimationRequests
protected

◆ m_PressureDeanimationRequests

ref array<bool> m_PressureDeanimationRequests
protected

◆ m_PressureTimesAccumulated

ref array<float> m_PressureTimesAccumulated
protected

◆ m_SpawnedWaterObject

Object m_SpawnedWaterObject
protected

Definition at line 123 of file Land_Underground_WaterReservoir.c.

Referenced by LateInit(), and SetWaterLevelHeight().

◆ m_ValveManipulatedIndex

◆ m_ValveManipulatedIndexPrev

int m_ValveManipulatedIndexPrev
protected

Definition at line 111 of file Land_Underground_WaterReservoir.c.

Referenced by Init(), and ResetState().

◆ m_ValveManipulationSound

ref EffectSound m_ValveManipulationSound
protected

Definition at line 129 of file Land_Underground_WaterReservoir.c.

Referenced by PlayValveManipulationSound().

◆ m_ValveManipulationSoundRequested

bool m_ValveManipulationSoundRequested
protected

VFX/SFX.

Definition at line 128 of file Land_Underground_WaterReservoir.c.

Referenced by OnVariablesSynchronized(), and PlayValveManipulationSound().

◆ m_ValveNames

ref array<string> m_ValveNames
protected

Definition at line 112 of file Land_Underground_WaterReservoir.c.

Referenced by GetTurnableValveIndex(), Init(), and RegisterValve().

◆ m_ValveParticles

ref ParticleSourceArray m_ValveParticles
protected

◆ m_ValveStates

◆ m_ValveStatesPacked

int m_ValveStatesPacked
protected

◆ m_ValveStatesPackedPrev

int m_ValveStatesPackedPrev
protected

Definition at line 109 of file Land_Underground_WaterReservoir.c.

Referenced by SyncValveVariables().

◆ m_WaterLevelActual

◆ m_WaterLevelDefault

vector m_WaterLevelDefault
protected

Definition at line 124 of file Land_Underground_WaterReservoir.c.

Referenced by LateInit(), and SetWaterLevelHeight().

◆ m_WaterLevelHeightActual

float m_WaterLevelHeightActual
protected

◆ m_WaterLevelMovementSound

ref EffectSound m_WaterLevelMovementSound
protected

◆ m_WaterLevelPrev

◆ m_WaterLevelsAvailable

◆ m_WaterLevelSnapshot

ref WaterLevelSnapshot m_WaterLevelSnapshot
protected

for deanimation purposes

Definition at line 87 of file Land_Underground_WaterReservoir.c.

Referenced by EOnPostSimulate(), and Init().

◆ m_WaterLevelTimesAccumulated

ref array<float> m_WaterLevelTimesAccumulated
protected

◆ OBJECT_NAME_WATER_PLANE

class WaterLevelSnapshot OBJECT_NAME_WATER_PLANE = "Land_Underground_WaterReservoir_Water"

Referenced by LateInit().

◆ PARTICLE_DRAIN_PIPE_MAX_PRESSURE

const int PARTICLE_DRAIN_PIPE_MAX_PRESSURE = ParticleList.WATER_SPILLING
protected

Definition at line 75 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PARTICLE_FILL_PIPE_JET

const int PARTICLE_FILL_PIPE_JET = ParticleList.WATER_JET
protected

Definition at line 77 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PARTICLE_FILL_PIPE_JET_WEAK

const int PARTICLE_FILL_PIPE_JET_WEAK = ParticleList.WATER_JET_WEAK
protected

Definition at line 78 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PARTICLE_FILL_PIPE_MAX_PRESSURE

const int PARTICLE_FILL_PIPE_MAX_PRESSURE = ParticleList.WATER_SPILLING
protected

Definition at line 76 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PIPE_CREAKING_MAX_TIME_DELAY_MS

const int PIPE_CREAKING_MAX_TIME_DELAY_MS = 15000
protected

Definition at line 141 of file Land_Underground_WaterReservoir.c.

Referenced by HandleSoundEffectsPipeCreaking().

◆ PIPE_CREAKING_MIN_TIME_DELAY_MS

const int PIPE_CREAKING_MIN_TIME_DELAY_MS = 10000
protected

Definition at line 140 of file Land_Underground_WaterReservoir.c.

Referenced by HandleSoundEffectsPipeCreaking().

◆ PIPE_CREAKING_SOUND_LOCATIONS

const string PIPE_CREAKING_SOUND_LOCATIONS[PIPE_CREAKING_SOUND_LOCATIONS_COUNT]
protected
Initial value:
= {
"pipe_creaking_sound_pos_1",
"pipe_creaking_sound_pos_2",
"pipe_creaking_sound_pos_3",
"pipe_creaking_sound_pos_4"
}

Definition at line 143 of file Land_Underground_WaterReservoir.c.

143 {
144 "pipe_creaking_sound_pos_1",
145 "pipe_creaking_sound_pos_2",
146 "pipe_creaking_sound_pos_3",
147 "pipe_creaking_sound_pos_4"
148 };

Referenced by PlayPipeCreakingSoundOnLocation().

◆ PIPE_CREAKING_SOUND_LOCATIONS_COUNT

const int PIPE_CREAKING_SOUND_LOCATIONS_COUNT = 4
protected

Definition at line 142 of file Land_Underground_WaterReservoir.c.

Referenced by PlayPipeCreakingSoundOnLocation().

◆ PIPE_INDEX_BROKEN1

const int PIPE_INDEX_BROKEN1 = 0
protected

Definition at line 49 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PIPE_INDEX_BROKEN2

const int PIPE_INDEX_BROKEN2 = 1
protected

main broken pipe

Definition at line 50 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PIPE_NAME_BROKEN1

const string PIPE_NAME_BROKEN1 = "pipe_broken_1"
protected

◆ PIPE_NAME_BROKEN2

const string PIPE_NAME_BROKEN2 = "pipe_broken_2"
protected

Definition at line 59 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PIPE_NAME_LEAKING_DRAIN

const string PIPE_NAME_LEAKING_DRAIN = "pipe_leaking_1"
protected

Definition at line 60 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PIPE_NAME_LEAKING_FILL

const string PIPE_NAME_LEAKING_FILL = "pipe_leaking_2"
protected

Definition at line 61 of file Land_Underground_WaterReservoir.c.

Referenced by HandleVisualEffects().

◆ PIPES_BROKEN_COUNT

const int PIPES_BROKEN_COUNT = 2
protected

Definition at line 48 of file Land_Underground_WaterReservoir.c.

Referenced by Init().

◆ PL_AVERAGE

const int PL_AVERAGE = 1
protected

◆ PL_MAX

const int PL_MAX = 2
protected

◆ PL_MIN

const int PL_MIN = 0
protected

◆ PressureLevel

class WaterLevelSettings PressureLevel

Referenced by PressureLevelSettings().

◆ SOUND_NAME_PIPE_CREAKING

const string SOUND_NAME_PIPE_CREAKING = "WaterObjectUndergroundPipeCreaking_SoundSet"
protected

Definition at line 63 of file Land_Underground_WaterReservoir.c.

Referenced by PlayPipeCreakingSoundOnLocation().

◆ SOUND_NAME_PIPE_SPRINKLING_END

const string SOUND_NAME_PIPE_SPRINKLING_END = "WaterObjectUndergroundPipeSprinkling_End_SoundSet"
protected

Definition at line 66 of file Land_Underground_WaterReservoir.c.

◆ SOUND_NAME_PIPE_SPRINKLING_LOOP1

const string SOUND_NAME_PIPE_SPRINKLING_LOOP1 = "WaterObjectUndergroundPipeSprinkling_Loop1_SoundSet"
protected

Definition at line 67 of file Land_Underground_WaterReservoir.c.

Referenced by HandleSoundEffectsPipeSprinkling().

◆ SOUND_NAME_PIPE_SPRINKLING_LOOP2

const string SOUND_NAME_PIPE_SPRINKLING_LOOP2 = "WaterObjectUndergroundPipeSprinkling_Loop2_SoundSet"
protected

Definition at line 68 of file Land_Underground_WaterReservoir.c.

Referenced by HandleSoundEffectsPipeSprinkling().

◆ SOUND_NAME_PIPE_SPRINKLING_START

const string SOUND_NAME_PIPE_SPRINKLING_START = "WaterObjectUndergroundPipeSprinkling_Start_SoundSet"
protected

Definition at line 65 of file Land_Underground_WaterReservoir.c.

Referenced by HandleSoundEffectsPipeSprinkling().

◆ SOUND_NAME_UPIPE_SPRINKLING_END

const string SOUND_NAME_UPIPE_SPRINKLING_END = "WaterObjectUndergroundUnderwaterPipe_End_SoundSet"
protected

◆ SOUND_NAME_UPIPE_SPRINKLING_LOOP

const string SOUND_NAME_UPIPE_SPRINKLING_LOOP = "WaterObjectUndergroundUnderwaterPipe_Loop_SoundSet"
protected

◆ SOUND_NAME_UPIPE_SPRINKLING_START

const string SOUND_NAME_UPIPE_SPRINKLING_START = "WaterObjectUndergroundUnderwaterPipe_Start_SoundSet"
protected

◆ SOUND_NAME_VALVE_MANIPULATION

const string SOUND_NAME_VALVE_MANIPULATION = "WaterObjectUndergroundValve_SoundSet"
protected

Definition at line 64 of file Land_Underground_WaterReservoir.c.

Referenced by PlayValveManipulationSound().

◆ SOUND_NAME_WATER_DRAIN_LOOP

const string SOUND_NAME_WATER_DRAIN_LOOP = "WaterObjectUndergroundUnderwaterEmpty_Loop_SoundSet"
protected

◆ SOUND_NAME_WATER_FILL_LOOP

const string SOUND_NAME_WATER_FILL_LOOP = "WaterObjectUndergroundUnderwaterFill_Loop_SoundSet"
protected

◆ VALVE_INDEX_DRAIN

◆ VALVE_INDEX_FILL

◆ VALVE_NAME_DRAIN

const string VALVE_NAME_DRAIN = "valve1"
protected

◆ VALVE_NAME_FILL

const string VALVE_NAME_FILL = "valve2"
protected

◆ VALVES_COUNT

const int VALVES_COUNT = 2
protected

◆ WATER_LEVEL_ABOVE_PIPES

const string WATER_LEVEL_ABOVE_PIPES = "water_level_above_pipes"
staticprotected

Definition at line 97 of file Land_Underground_WaterReservoir.c.

Referenced by HeightToWaterLevel(), and WaterLevelToHeight().

◆ WATER_LEVEL_AVERAGE

const string WATER_LEVEL_AVERAGE = "water_level_average"
staticprotected

◆ WATER_LEVEL_MAX

const string WATER_LEVEL_MAX = "water_level_max"
staticprotected

Definition at line 95 of file Land_Underground_WaterReservoir.c.

Referenced by HeightToWaterLevel(), and WaterLevelToHeight().

◆ WATER_LEVEL_MIN

const string WATER_LEVEL_MIN = "water_level_min"
staticprotected

Definition at line 98 of file Land_Underground_WaterReservoir.c.

Referenced by HeightToWaterLevel(), and WaterLevelToHeight().

◆ WATER_LEVELS

◆ WATER_LEVELS_COUNT

const int WATER_LEVELS_COUNT = 4
protected

◆ WL_ABOVE_PIPES

◆ WL_AVERAGE

◆ WL_MAX

◆ WL_MIN