DayZ 1.24
Loading...
Searching...
No Matches
Land_Underground_WaterReservoir.c
Go to the documentation of this file.
12
14{
16 float Duration;
17
23}
24
30
31class Land_Underground_WaterReservoir : BuildingBase
32{
33 protected const string OBJECT_NAME_WATER_PLANE = "Land_Underground_WaterReservoir_Water";
34
35 protected const int WL_MIN = 0;
36 protected const int WL_ABOVE_PIPES = 1;
37 protected const int WL_AVERAGE = 2;
38 protected const int WL_MAX = 3;
39
40 protected const int PL_MIN = 0;
41 protected const int PL_AVERAGE = 1;
42 protected const int PL_MAX = 2;
43
44 protected const int VALVES_COUNT = 2;
45 protected const int VALVE_INDEX_DRAIN = 0;
46 protected const int VALVE_INDEX_FILL = 1;
47
48 protected const int PIPES_BROKEN_COUNT = 2;
49 protected const int PIPE_INDEX_BROKEN1 = 0;
50 protected const int PIPE_INDEX_BROKEN2 = 1;
51
52 protected const string ANIM_PHASE_VALVE_GAUGE_DRAIN = "ValveGauge1";
53 protected const string ANIM_PHASE_VALVE_GAUGE_FILL = "ValveGauge2";
54 protected const string ANIM_PHASE_VALVE_DRAIN = "Valve1";
55 protected const string ANIM_PHASE_VALVE_FILL = "Valve2";
56 protected const string VALVE_NAME_DRAIN = "valve1";
57 protected const string VALVE_NAME_FILL = "valve2";
58 protected const string PIPE_NAME_BROKEN1 = "pipe_broken_1";
59 protected const string PIPE_NAME_BROKEN2 = "pipe_broken_2";
60 protected const string PIPE_NAME_LEAKING_DRAIN = "pipe_leaking_1";
61 protected const string PIPE_NAME_LEAKING_FILL = "pipe_leaking_2";
62
63 protected const string SOUND_NAME_PIPE_CREAKING = "WaterObjectUndergroundPipeCreaking_SoundSet";
64 protected const string SOUND_NAME_VALVE_MANIPULATION = "WaterObjectUndergroundValve_SoundSet";
65 protected const string SOUND_NAME_PIPE_SPRINKLING_START = "WaterObjectUndergroundPipeSprinkling_Start_SoundSet";
66 protected const string SOUND_NAME_PIPE_SPRINKLING_END = "WaterObjectUndergroundPipeSprinkling_End_SoundSet";
67 protected const string SOUND_NAME_PIPE_SPRINKLING_LOOP1 = "WaterObjectUndergroundPipeSprinkling_Loop1_SoundSet";
68 protected const string SOUND_NAME_PIPE_SPRINKLING_LOOP2 = "WaterObjectUndergroundPipeSprinkling_Loop2_SoundSet";
69 protected const string SOUND_NAME_UPIPE_SPRINKLING_START = "WaterObjectUndergroundUnderwaterPipe_Start_SoundSet";
70 protected const string SOUND_NAME_UPIPE_SPRINKLING_END = "WaterObjectUndergroundUnderwaterPipe_End_SoundSet";
71 protected const string SOUND_NAME_UPIPE_SPRINKLING_LOOP = "WaterObjectUndergroundUnderwaterPipe_Loop_SoundSet";
72 protected const string SOUND_NAME_WATER_FILL_LOOP = "WaterObjectUndergroundUnderwaterFill_Loop_SoundSet";
73 protected const string SOUND_NAME_WATER_DRAIN_LOOP = "WaterObjectUndergroundUnderwaterEmpty_Loop_SoundSet";
74
79
88
94
95 protected static const string WATER_LEVEL_MAX = "water_level_max";
96 protected static const string WATER_LEVEL_AVERAGE = "water_level_average";
97 protected static const string WATER_LEVEL_ABOVE_PIPES = "water_level_above_pipes";
98 protected static const string WATER_LEVEL_MIN = "water_level_min";
99
100 protected const int WATER_LEVELS_COUNT = 4;
107
108 protected int m_ValveStatesPacked;
115 protected int m_WaterLevelActual;
116 protected int m_WaterLevelPrev;
121 protected int m_LastActiveValve;
122
126
131
134
135 protected bool m_PipeUnderwaterSoundRunning
137
139
140 protected const int PIPE_CREAKING_MIN_TIME_DELAY_MS = 10000;
141 protected const int PIPE_CREAKING_MAX_TIME_DELAY_MS = 15000;
142 protected const int PIPE_CREAKING_SOUND_LOCATIONS_COUNT = 4;
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 };
149
152
154 {
155 SetEventMask(EntityEvent.POSTSIMULATE);
156
157 Init();
158 }
159
165
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 }
301
314
315 override void SetActions()
316 {
317 super.SetActions();
318
320 }
321
323 {
324 return true;
325 }
326
327 protected void Init()
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 }
379
401
403 {
409
415
419
425
431
435 }
436
441
442 protected bool IsAnyValveActive()
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 }
452
453 protected bool IsValveActive(int pValveIndex)
454 {
456 }
457
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 }
469
471 {
472 if (GetGame().IsServer())
473 {
476 SetSynchDirty();
477 }
478 }
479
507
509 {
510 if (GetGame().IsServer())
511 {
514 SetSynchDirty();
515 }
516 }
517
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 }
542
543 protected void SetLastActiveValve(int pValveIndex)
544 {
546 }
547
548 protected void SetWaterLevelHeight(float pHeight)
549 {
550 if (GetGame() && GetGame().IsServer())
551 {
555
557 m_SpawnedWaterObject.SetPosition(pos);
558 }
559 }
560
571
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 }
584
585 protected float WaterLevelToHeight(int pWaterLevel)
586 {
587 switch (pWaterLevel)
588 {
589 case WL_MIN:
591 case WL_ABOVE_PIPES:
593 case WL_AVERAGE:
595 case WL_MAX:
597 }
598
599 return 0;
600 }
601
615
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 }
630
656
673
692
727
756
775
777 {
778 switch (pValveIndex)
779 {
782 break;
783 case VALVE_INDEX_FILL:
785 break;
786 }
787 }
788
789 protected void AnimateValve(int pValveIndex, float pPhase)
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 }
801
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 }
814
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 }
829
831 {
832 switch (pValveIndex)
833 {
836 break;
837 case VALVE_INDEX_FILL:
839 break;
840 }
841
842 return 0.0;
843 }
844
845 protected float AdjustTime(float originalTime)
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 }
857
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 }
872
880
893
914
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 }
968
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 }
998
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 }
1017
1023
1030
1031 protected void HandleVisualEffects()
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 }
1100
1101 protected void CleanVisualEffects()
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 }
1121
1122
1145
1146 protected void SyncValveVariables()
1147 {
1148 if (GetGame())
1149 {
1152 {
1154 SetSynchDirty();
1155 }
1156 }
1157 }
1158
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 }
1171
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 }
1185
1186#ifdef DEVELOPER
1187 override protected string GetDebugText()
1188 {
1189 string debug_output = "";
1190 debug_output += string.Format("\nm_WaterLevelActual: %1", m_WaterLevelActual);
1191 debug_output += string.Format("\nm_WaterLevelPrev: %1", m_WaterLevelPrev);
1192 debug_output += string.Format("\nm_ValveManipulatedIndex: %1", m_ValveManipulatedIndex);
1193
1194 int valve;
1195 for (valve = 0; valve < VALVES_COUNT; ++valve)
1196 debug_output += string.Format("\nvalve %1 state:%2 | pressure req: %2", valve, m_ValveStates[valve], m_PressureAnimationRequests[valve]);
1197
1198 return debug_output;
1199 }
1200
1202 {
1203 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SPECIALIZED_ACTION1, "Reset state", FadeColors.LIGHT_GREY));
1204 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SPECIALIZED_ACTION2, "Drain", FadeColors.LIGHT_GREY));
1205 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SPECIALIZED_ACTION3, "Fill", FadeColors.LIGHT_GREY));
1206 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
1207
1208 super.GetDebugActions(outputList);
1209 }
1210
1211 override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
1212 {
1213 if (super.OnAction(action_id, player, ctx))
1214 return true;
1215 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
1216 {
1217 if (action_id == EActions.SPECIALIZED_ACTION1)
1218 {
1219 ResetState();
1224 }
1225 else if (action_id == EActions.SPECIALIZED_ACTION2)
1226 {
1227 ResetState();
1233 }
1234 else if (action_id == EActions.SPECIALIZED_ACTION3)
1235 {
1236 ResetState();
1242 SetSynchDirty();
1243 }
1244 }
1245 return false;
1246 }
1247
1248
1249#endif
1250}
1251
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
ActionTurnValveUndergroundReservoirCB ActionTurnValveCB ActionTurnValveUndergroundReservoir()
void AddAction(typename actionName)
void SetActions()
override void OnVariablesSynchronized()
vector GetOrientation()
const int ECE_CREATEPHYSICS
override Widget Init()
Definition DayZGame.c:120
EActions
Definition EActions.c:2
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Definition ItemBase.c:6834
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Definition ItemBase.c:6792
ref ParticleSourceArray m_PipeBrokenParticles
ref array< ref PressureLevelSettings > m_DrainValvePressureDeanimationSettings
float m_WaterLevelHeightActual
void RegisterValve(string pCompName, int pIndex)
const int PIPE_INDEX_BROKEN1
override void EOnPostSimulate(IEntity other, float timeSlice)
ref ParticleSourceArray m_ValveParticles
ref map< string, vector > m_WaterLevelsAvailable
const string SOUND_NAME_PIPE_SPRINKLING_START
void SetDefaultPressureLevelStageSettings(int pValveIndex)
bool IsValvePressureLevelGaugeAtBase(int pValveIndex)
void HandleSoundEffectsWaterLevelMovementSounds()
const string SOUND_NAME_PIPE_CREAKING
ref array< ref PressureLevelSettings > m_FillValvePressureStageSettings
override bool HasTurnableValveBehavior()
const string ANIM_PHASE_VALVE_GAUGE_FILL
const int PARTICLE_FILL_PIPE_JET
PressureLevelSettings ActualPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
ref array< ref PressureLevelSettings > m_FillValvePressureDeanimationSettings
const string SOUND_NAME_WATER_FILL_LOOP
static const string WATER_LEVEL_MIN
const int PARTICLE_FILL_PIPE_MAX_PRESSURE
ref array< ref WaterLevelSettings > m_DrainValveWaterStageSettings
valve/pipe stages for water and pressure levels
int m_DrainValvePressureLevelStageIndex
ref array< ref WaterLevelSettings > m_FillValveWaterStageSettings
for deanimation purposes
ref EffectSound m_WaterLevelMovementSound
const string VALVE_NAME_FILL
const string WATER_LEVELS[WATER_LEVELS_COUNT]
void PlayPipeCreakingSoundOnLocation()
ref array< bool > m_PressureDeanimationRequests
const string PIPE_NAME_BROKEN1
const string ANIM_PHASE_VALVE_FILL
WaterLevelSettings ActualWaterLevelStageSettings(int pValveIndex)
void OnValveManipulationStart(int pValveIndex)
void SetLastActiveValve(int pValveIndex)
void HandleSoundEffectsUnderwaterPipeSounds()
const string PIPE_NAME_LEAKING_DRAIN
const int VALVES_COUNT
const int PARTICLE_DRAIN_PIPE_MAX_PRESSURE
class WaterLevelSettings PressureLevel
const string SOUND_NAME_PIPE_SPRINKLING_LOOP2
void AdvanceToNextPressureLevelStageSettings(int pValveIndex)
bool m_ValveManipulationSoundRequested
VFX/SFX.
ref array< ref PressureLevelSettings > m_DrainValvePressureStageSettings
const string SOUND_NAME_VALVE_MANIPULATION
const int VALVE_INDEX_DRAIN
const string ANIM_PHASE_VALVE_DRAIN
PressureLevelSettings PreviousPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
const string SOUND_NAME_WATER_DRAIN_LOOP
int PackArrayOfBoolStatesIntoBits(array< bool > pStates)
void SetWaterLevelHeight(float pHeight)
void OnValveManipulationEnd(int pValveIndex)
ref array< bool > m_ValveStates
void SetValvePressureLevelGauge(int pValveIndex, float pValue)
ref array< string > m_ValveNames
array< bool > UnpackBitsToArrayOfBoolStates(int pPackedBits, int pArrayLength)
float WaterLevelToHeight(int pWaterLevel)
void Land_Underground_WaterReservoir()
array< vector > GetValveAligningPointsWS(int pValveIndex)
void HandleSoundEffectsPipeCreaking()
ref EffectSound m_ValveManipulationSound
const string PIPE_NAME_LEAKING_FILL
float GetValvePressureLevelGauge(int pValveIndex)
static const string WATER_LEVEL_MAX
const int PIPE_CREAKING_SOUND_LOCATIONS_COUNT
const int PIPE_INDEX_BROKEN2
main broken pipe
void OnValveManipulationCanceled(int pValveIndex)
bool m_PipeCreakingSoundRequested
ref array< float > m_PressureTimesAccumulated
WaterLevelSettings PreviousWaterLevelStageSettings(int pValveIndex)
const int WATER_LEVELS_COUNT
bool IsValveActive(int pValveIndex)
ref array< EffectSound > m_PipeSounds
override bool IsValveTurnable(int pValveIndex)
const int PARTICLE_FILL_PIPE_JET_WEAK
const string PIPE_CREAKING_SOUND_LOCATIONS[PIPE_CREAKING_SOUND_LOCATIONS_COUNT]
static const string WATER_LEVEL_ABOVE_PIPES
void AdvanceToNextWaterLevelStageSettings(int pValveIndex)
const string VALVE_NAME_DRAIN
const int PIPE_CREAKING_MIN_TIME_DELAY_MS
float PressureLevelToValue(int pPressureLevel)
void ~Land_Underground_WaterReservoir()
const int VALVE_INDEX_FILL
void HandleSoundEffectsPipeSprinkling()
const string SOUND_NAME_PIPE_SPRINKLING_LOOP1
ref WaterLevelSnapshot m_WaterLevelSnapshot
for deanimation purposes
int m_DrainValveWaterLevelStageIndex
pointing to specific stage for each valve/pipe
const int PIPES_BROKEN_COUNT
int m_FillValveWaterLevelStageIndex
override int GetTurnableValveIndex(int pComponentIndex)
const int WL_AVERAGE
float AdjustTime(float originalTime)
const string SOUND_NAME_UPIPE_SPRINKLING_START
const string PIPE_NAME_BROKEN2
const string SOUND_NAME_UPIPE_SPRINKLING_END
int HeightToWaterLevel(float pHeight)
ref array< float > m_WaterLevelTimesAccumulated
void TranslateMemoryPointsToWaterLevels()
int m_FillValvePressureLevelStageIndex
Object m_SpawnedWaterObject
void AnimateValve(int pValveIndex, float pPhase)
ref EffectSound m_PipeUnderwaterSound
ref array< bool > m_PressureAnimationRequests
class WaterLevelSnapshot OBJECT_NAME_WATER_PLANE
const string SOUND_NAME_PIPE_SPRINKLING_END
const int WL_ABOVE_PIPES
const string SOUND_NAME_UPIPE_SPRINKLING_LOOP
ref EffectSound m_PipeCreakingSounds
static const string WATER_LEVEL_AVERAGE
const string ANIM_PHASE_VALVE_GAUGE_DRAIN
tighter broken pipe
void PlayValveManipulationSound()
void PressureLevelSettings(int pPressureLevel, float pDuration)
const int PIPE_CREAKING_MAX_TIME_DELAY_MS
void ConfigureValvesAndGaugesCourse()
vector GetMemoryPointPosition(string pMemoryPoint)
const int PL_AVERAGE
string GetDebugText()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
array< ParticleSource > ParticleSourceArray
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
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
Definition EnMath.c:7
static const int WATER_JET
static const int WATER_JET_WEAK
static const int WATER_SPILLING
Manager class for managing Effect (EffectParticle, EffectSound)
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
void WaterLevelSettings(int pWaterLevel, float pDuration)
static const vector Zero
Definition EnConvert.c:110
const int INDEX_NOT_FOUND
Definition gameplay.c:13
proto native CGame GetGame()
enum ShapeType ErrorEx
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:44
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
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'.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
const int SAT_DEBUG_ACTION
Definition constants.c:424
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8