Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
land_underground_waterreservoir.c
Go to the documentation of this file.
2 {
3  int WaterLevel;
4  float Duration;
5 
6  void WaterLevelSettings(int pWaterLevel, float pDuration)
7  {
8  WaterLevel = pWaterLevel;
9  Duration = pDuration;
10  }
11 }
12 
14 {
15  int PressureLevel;
16  float Duration;
17 
18  void PressureLevelSettings(int pPressureLevel, float pDuration)
19  {
20  PressureLevel = pPressureLevel;
21  Duration = pDuration;
22  }
23 }
24 
26 {
27  float WaterHeight;
28  float RemainingDuration;
29 }
30 
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 
75  protected const int PARTICLE_DRAIN_PIPE_MAX_PRESSURE = ParticleList.WATER_SPILLING;
76  protected const int PARTICLE_FILL_PIPE_MAX_PRESSURE = ParticleList.WATER_SPILLING;
77  protected const int PARTICLE_FILL_PIPE_JET = ParticleList.WATER_JET;
78  protected const int PARTICLE_FILL_PIPE_JET_WEAK = ParticleList.WATER_JET_WEAK;
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;
101  protected const string WATER_LEVELS[WATER_LEVELS_COUNT] = {
102  WATER_LEVEL_MAX,
103  WATER_LEVEL_AVERAGE,
104  WATER_LEVEL_ABOVE_PIPES,
105  WATER_LEVEL_MIN
106  };
107 
108  protected int m_ValveStatesPacked;
109  protected int m_ValveStatesPackedPrev;
110  protected int m_ValveManipulatedIndex;
113  protected ref array<bool> m_ValveStates;
115  protected int m_WaterLevelActual;
116  protected int m_WaterLevelPrev;
121  protected int m_LastActiveValve;
122 
125  protected float m_WaterLevelHeightActual;
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 
161  {
164  }
165 
166  override void EOnPostSimulate(IEntity other, float timeSlice)
167  {
168  #ifndef SERVER
171  #endif
172 
173  if (!GetGame().IsServer())
174  {
175  return;
176  }
177 
178  int valve;
179  float waterHeight, pressureLevel;
180  WaterLevelSettings wlStageSettings, wlStageSettingsPrev;
181  PressureLevelSettings plStageSettings, plStageSettingsPrev;
182 
185  for (valve = 0; valve < VALVES_COUNT; ++valve)
186  {
187  if (m_LastActiveValve != INDEX_NOT_FOUND && m_LastActiveValve != valve && m_ValveStates[valve] == true)
188  {
189  wlStageSettings = ActualWaterLevelStageSettings(valve);
192  m_WaterLevelSnapshot.RemainingDuration = Math.Clamp(wlStageSettings.Duration - m_WaterLevelTimesAccumulated[valve], 0, wlStageSettings.Duration);
193  m_ValveStates[valve] = false;
194  m_PressureDeanimationRequests[valve] = true;
195  break;
196  }
197  }
198 
200  for (valve = 0; valve < VALVES_COUNT; ++valve)
201  {
202  if (m_ValveStates[valve] == true)
203  {
204  wlStageSettingsPrev = PreviousWaterLevelStageSettings(valve);
205  wlStageSettings = ActualWaterLevelStageSettings(valve);
206 
208  if (wlStageSettings.Duration == -1.0)
209  {
210  m_ValveStates[valve] = false;
211  m_WaterLevelTimesAccumulated[valve] = 0;
212  m_WaterLevelSnapshot = null;
214  return;
215  }
216 
217  float adjustedWaterHeight = WaterLevelToHeight(wlStageSettingsPrev.WaterLevel);
218  float adjustedDuration = wlStageSettings.Duration;
220  {
221  adjustedWaterHeight = m_WaterLevelSnapshot.WaterHeight;
222  adjustedDuration = wlStageSettings.Duration + m_WaterLevelSnapshot.RemainingDuration;
223  }
224 
225  if (m_WaterLevelTimesAccumulated[valve] <= adjustedDuration)
226  {
227  float start = adjustedWaterHeight;
228  float target = WaterLevelToHeight(wlStageSettings.WaterLevel);
229  waterHeight = Math.Lerp(start, target, Easing.EaseInOutSine(m_WaterLevelTimesAccumulated[valve] / adjustedDuration));
230  SetWaterLevelHeight(waterHeight);
231  }
232  else
233  {
234  m_WaterLevelTimesAccumulated[valve] = 0;
235  m_WaterLevelSnapshot = null;
237  SetSynchDirty();
238  }
239 
241  }
242  else
243  {
244  m_WaterLevelTimesAccumulated[valve] = 0;
246  }
247  }
248 
249  int allValvesStates = 0;
250 
252  for (valve = 0; valve < VALVES_COUNT; ++valve)
253  {
254  if (m_PressureAnimationRequests[valve] == true)
255  {
256  bool hasToBeDeanimated = m_PressureAnimationRequests[valve] == m_PressureDeanimationRequests[valve];
257  plStageSettingsPrev = PreviousPressureLevelStageSettings(valve, hasToBeDeanimated);
258  plStageSettings = ActualPressureLevelStageSettings(valve, hasToBeDeanimated);
259 
261  if (plStageSettings.Duration == -1.0)
262  {
263  m_PressureTimesAccumulated[valve] = 0;
264  m_PressureAnimationRequests[valve] = false;
266  return;
267  }
268 
269  if (m_PressureTimesAccumulated[valve] <= plStageSettings.Duration)
270  {
271  float plStart = PressureLevelToValue(plStageSettingsPrev.PressureLevel);
272  float plTarget = PressureLevelToValue(plStageSettings.PressureLevel);
273  pressureLevel = Math.Lerp(plStart, plTarget, m_PressureTimesAccumulated[valve] / plStageSettings.Duration);
274  SetValvePressureLevelGauge(valve, pressureLevel);
275  }
276  else
277  {
278  m_PressureTimesAccumulated[valve] = 0;
280  if (hasToBeDeanimated && IsValvePressureLevelGaugeAtBase(valve))
281  {
282  m_PressureDeanimationRequests[valve] = false;
284  }
285  else
286  {
288  SetSynchDirty();
289  }
290  }
291 
293  }
294  else
295  {
296  m_PressureTimesAccumulated[valve] = 0;
297  }
298 
299 
300  allValvesStates += m_PressureAnimationRequests[valve];
301  if (allValvesStates == false)
302  {
304  }
305  }
306  }
307 
308  override void OnVariablesSynchronized()
309  {
310  super.OnVariablesSynchronized();
311 
313 
316 
317  if (m_ValveManipulatedIndex == -1)
319  }
320 
321  override void SetActions()
322  {
323  super.SetActions();
324 
326  }
327 
328  override bool HasTurnableValveBehavior()
329  {
330  return true;
331  }
332 
333  protected void Init()
334  {
335  m_ValveNames = new array<string>();
336  m_ValveStates = new array<bool>();
348  m_WaterLevelSnapshot = null;
349 
352 
356 
360 
362  int i = 0;
363  for (i = 0; i < VALVES_COUNT; ++i)
364  {
365  m_ValveNames.Insert("none");
366  m_ValveStates.Insert(false);
367  m_PressureAnimationRequests.Insert(false);
368  m_PressureDeanimationRequests.Insert(false);
369  m_WaterLevelTimesAccumulated.Insert(-1);
370  m_PressureTimesAccumulated.Insert(-1);
371  m_PipeSounds.Insert(null);
372  m_ValveParticles.Insert(null);
373  }
374 
375  for (i = 0; i < PIPES_BROKEN_COUNT; ++i)
376  {
377  m_PipeBrokenParticles.Insert(null);
378  }
379 
380  RegisterNetSyncVariableInt("m_ValveStatesPacked", 0);
381  RegisterNetSyncVariableInt("m_ValveManipulatedIndex", -1, VALVES_COUNT - 1);
382  RegisterNetSyncVariableInt("m_WaterLevelActual", WL_MIN, WL_MAX);
383  RegisterNetSyncVariableInt("m_WaterLevelPrev", WL_MIN, WL_MAX);
384 
385  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(LateInit, 250);
386  }
387 
388  protected void LateInit()
389  {
392 
394 
396 
397  m_WaterLevelDefault = m_WaterLevelsAvailable[WATER_LEVEL_AVERAGE];
398 
399  if (GetGame().IsServer())
400  {
402  m_SpawnedWaterObject.SetOrientation(GetOrientation());
404  }
405 
406  GetGame().RegisterNetworkStaticObject(this);
407  SetSynchDirty();
408  }
409 
411  {
417 
423 
427 
433 
439 
443  }
444 
445  override bool IsValveTurnable(int pValveIndex)
446  {
447  return !IsValveActive(pValveIndex) && IsValvePressureLevelGaugeAtBase(pValveIndex);
448  }
449 
450  protected bool IsAnyValveActive()
451  {
452  for (int i = 0; i < m_ValveStates.Count(); ++i)
453  {
454  if (m_ValveStates[i])
455  {
456  return true;
457  }
458  }
459 
460  return false;
461  }
462 
463  protected bool IsValveActive(int pValveIndex)
464  {
465  return pValveIndex >= 0 && pValveIndex <= VALVES_COUNT && m_ValveStates[pValveIndex];
466  }
467 
468  override int GetTurnableValveIndex(int pComponentIndex)
469  {
470  string targetedValveName = GetActionComponentName(pComponentIndex);
471  for (int i = 0; i < m_ValveNames.Count(); ++i)
472  {
473  if (m_ValveNames[i] == targetedValveName)
474  {
475  return i;
476  }
477  }
478 
479  return INDEX_NOT_FOUND;
480  }
481 
482  void OnValveManipulationStart(int pValveIndex)
483  {
484  if (GetGame().IsServer())
485  {
486  AnimateValve(pValveIndex, 1);
487  m_ValveManipulatedIndex = pValveIndex;
488  SetSynchDirty();
489  }
490  }
491 
492  void OnValveManipulationEnd(int pValveIndex)
493  {
494  if (GetGame().IsServer())
495  {
496  switch (pValveIndex)
497  {
498  case VALVE_INDEX_DRAIN:
499  m_ValveStates[pValveIndex] = true;
500  m_PressureAnimationRequests[pValveIndex] = true;
503  SetLastActiveValve(pValveIndex);
504  AnimateValve(pValveIndex, 0);
505  break;
506  case VALVE_INDEX_FILL:
507  m_ValveStates[pValveIndex] = true;
508  m_PressureAnimationRequests[pValveIndex] = true;
511  AnimateValve(pValveIndex, 0);
512  SetLastActiveValve(pValveIndex);
513  break;
514  }
515 
517  }
518  }
519 
520  void OnValveManipulationCanceled(int pValveIndex)
521  {
522  if (GetGame().IsServer())
523  {
524  AnimateValve(pValveIndex, 0);
526  SetSynchDirty();
527  }
528  }
529 
533  {
534  vector posPoint, dirPoint = vector.Zero;
535 
536  switch (pValveIndex)
537  {
538  case VALVE_INDEX_DRAIN:
539  posPoint = GetMemoryPointPosition(string.Format("%1_align_pos", VALVE_NAME_DRAIN));
540  dirPoint = GetMemoryPointPosition(string.Format("%1_align_dir", VALVE_NAME_DRAIN));
541  break;
542  case VALVE_INDEX_FILL:
543  posPoint = GetMemoryPointPosition(string.Format("%1_align_pos", VALVE_NAME_FILL));
544  dirPoint = GetMemoryPointPosition(string.Format("%1_align_dir", VALVE_NAME_FILL));
545  break;
546  }
547 
548  array<vector> valvePositions = new array<vector>();
549  valvePositions.Insert(posPoint);
550  valvePositions.Insert(dirPoint);
551 
552  return valvePositions;
553  }
554 
555  protected void SetLastActiveValve(int pValveIndex)
556  {
557  m_LastActiveValve = pValveIndex;
558  }
559 
560  protected void SetWaterLevelHeight(float pHeight)
561  {
562  if (GetGame() && GetGame().IsServer())
563  {
564  vector pos = Vector(m_WaterLevelDefault[0], pHeight, m_WaterLevelDefault[2]);
565  m_WaterLevelHeightActual = pHeight;
567 
569  {
570  m_SpawnedWaterObject.SetPosition(pos);
571  }
572  }
573  }
574 
575  protected void RegisterValve(string pCompName, int pIndex)
576  {
577  m_ValveNames.Set(pIndex, pCompName);
578  m_ValveStates.Set(pIndex, false);
579  m_PressureAnimationRequests.Set(pIndex, 0);
580  m_PressureDeanimationRequests.Set(pIndex, 0);
581  m_WaterLevelTimesAccumulated.Set(pIndex, 0);
582  m_PressureTimesAccumulated.Set(pIndex, false);
583  m_PipeSounds.Set(pIndex, null);
584  }
585 
587  {
588  m_WaterLevelsAvailable.Clear();
589  for (int i = 0; i < WATER_LEVELS_COUNT; ++i)
590  {
591  if (MemoryPointExists(WATER_LEVELS[i]))
592  {
593  if (!m_WaterLevelsAvailable.Contains(WATER_LEVELS[i]))
594  {
595  m_WaterLevelsAvailable.Insert(WATER_LEVELS[i], ModelToWorld(GetMemoryPointPos(WATER_LEVELS[i])));
596  }
597  }
598  }
599  }
600 
601  protected float WaterLevelToHeight(int pWaterLevel)
602  {
603  switch (pWaterLevel)
604  {
605  case WL_MIN:
606  return m_WaterLevelsAvailable[WATER_LEVEL_MIN][1];
607  case WL_ABOVE_PIPES:
608  return m_WaterLevelsAvailable[WATER_LEVEL_ABOVE_PIPES][1];
609  case WL_AVERAGE:
610  return m_WaterLevelsAvailable[WATER_LEVEL_AVERAGE][1];
611  case WL_MAX:
612  return m_WaterLevelsAvailable[WATER_LEVEL_MAX][1];
613  }
614 
615  return 0;
616  }
617 
618  protected int HeightToWaterLevel(float pHeight)
619  {
620  if (pHeight <= m_WaterLevelsAvailable[WATER_LEVEL_MIN][1])
621  {
622  return WL_MIN;
623  }
624  else if (pHeight > m_WaterLevelsAvailable[WATER_LEVEL_MIN][1] && pHeight <= m_WaterLevelsAvailable[WATER_LEVEL_ABOVE_PIPES][1])
625  {
626  return WL_ABOVE_PIPES;
627  }
628  else if (pHeight > m_WaterLevelsAvailable[WATER_LEVEL_ABOVE_PIPES][1] && pHeight <= m_WaterLevelsAvailable[WATER_LEVEL_AVERAGE][1])
629  {
630  return WL_AVERAGE;
631  }
632  else if (pHeight < m_WaterLevelsAvailable[WATER_LEVEL_MAX][1] && pHeight >= m_WaterLevelsAvailable[WATER_LEVEL_AVERAGE][1])
633  {
634  return WL_AVERAGE;
635  }
636 
637  return WL_MAX;
638  }
639 
640  protected float PressureLevelToValue(int pPressureLevel)
641  {
642  switch (pPressureLevel)
643  {
644  case PL_MIN:
645  return 0.0;
646  case PL_AVERAGE:
647  return 0.5;
648  case PL_MAX:
649  return 1.0;
650  }
651 
652  return 0.0;
653  }
654 
656  {
657  WaterLevelSettings wlStageSettings;
658 
659  switch (pValveIndex)
660  {
661  case VALVE_INDEX_DRAIN:
663  {
665  }
666  else
667  {
669  }
670  break;
671  case VALVE_INDEX_FILL:
673  {
675  }
676  else
677  {
679  }
680  break;
681  }
682 
683  m_WaterLevelPrev = wlStageSettings.WaterLevel;
684  SetSynchDirty();
685 
686  return wlStageSettings;
687  }
688 
690  {
691  WaterLevelSettings wlStageSettings;
692 
693  switch (pValveIndex)
694  {
695  case VALVE_INDEX_DRAIN:
697  break;
698  case VALVE_INDEX_FILL:
700  break;
701  }
702 
703  return wlStageSettings;
704  }
705 
706  protected void AdvanceToNextWaterLevelStageSettings(int pValveIndex)
707  {
708  switch (pValveIndex)
709  {
710  case VALVE_INDEX_DRAIN:
712  {
714  }
715  else
716  {
718  }
719  break;
720  case VALVE_INDEX_FILL:
722  {
724  }
725  else
726  {
728  }
729  break;
730  }
731  }
732 
733  protected PressureLevelSettings PreviousPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest = false)
734  {
735  PressureLevelSettings plStageSettings;
736 
737  switch (pValveIndex)
738  {
739  case VALVE_INDEX_DRAIN:
740  if (pDeanimationRequest)
741  {
742  plStageSettings = m_FillValvePressureDeanimationSettings[0];
743  return plStageSettings;
744  }
745 
747  {
749  }
750  else
751  {
753  }
754  break;
755  case VALVE_INDEX_FILL:
756  if (pDeanimationRequest)
757  {
758  plStageSettings = m_FillValvePressureDeanimationSettings[0];
759  return plStageSettings;
760  }
761 
763  {
765  }
766  else
767  {
769  }
770  break;
771  }
772 
773  return plStageSettings;
774  }
775 
776  protected PressureLevelSettings ActualPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest = false)
777  {
778  PressureLevelSettings plStageSettings;
779 
780  switch (pValveIndex)
781  {
782  case VALVE_INDEX_DRAIN:
783  if (pDeanimationRequest)
784  {
785  plStageSettings = m_DrainValvePressureDeanimationSettings[1];
786  return plStageSettings;
787  }
788 
790  break;
791  case VALVE_INDEX_FILL:
792  if (pDeanimationRequest)
793  {
794  plStageSettings = m_FillValvePressureDeanimationSettings[1];
795  return plStageSettings;
796  }
797 
799  break;
800  }
801 
802  return plStageSettings;
803  }
804 
805  protected void AdvanceToNextPressureLevelStageSettings(int pValveIndex)
806  {
807  switch (pValveIndex)
808  {
809  case VALVE_INDEX_DRAIN:
811  {
813  }
814  else
815  {
817  }
818  break;
819  case VALVE_INDEX_FILL:
821  {
823  }
824  else
825  {
827  }
828  break;
829  }
830  }
831 
832  protected void SetDefaultPressureLevelStageSettings(int pValveIndex)
833  {
834  switch (pValveIndex)
835  {
836  case VALVE_INDEX_DRAIN:
838  break;
839  case VALVE_INDEX_FILL:
841  break;
842  }
843  }
844 
845  protected void AnimateValve(int pValveIndex, float pPhase)
846  {
847  switch (pValveIndex)
848  {
849  case VALVE_INDEX_DRAIN:
850  SetAnimationPhase(ANIM_PHASE_VALVE_DRAIN, pPhase);
851  break;
852  case VALVE_INDEX_FILL:
853  SetAnimationPhase(ANIM_PHASE_VALVE_FILL, pPhase);
854  break;
855  }
856  }
857 
858  protected void SetValvePressureLevelGauge(int pValveIndex, float pValue)
859  {
860  switch (pValveIndex)
861  {
862  case VALVE_INDEX_DRAIN:
863  SetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_DRAIN, pValue);
864  break;
865  case VALVE_INDEX_FILL:
866  SetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_FILL, pValue);
867  break;
868  }
869  }
870 
871  protected float GetValvePressureLevelGauge(int pValveIndex)
872  {
873  switch (pValveIndex)
874  {
875  case VALVE_INDEX_DRAIN:
876  return GetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_DRAIN);
877  break;
878  case VALVE_INDEX_FILL:
879  return GetAnimationPhase(ANIM_PHASE_VALVE_GAUGE_FILL);
880  break;
881  }
882 
883  return 0;
884  }
885 
886  protected bool IsValvePressureLevelGaugeAtBase(int pValveIndex)
887  {
888  switch (pValveIndex)
889  {
890  case VALVE_INDEX_DRAIN:
891  return GetValvePressureLevelGauge(pValveIndex) <= 0.01;
892  break;
893  case VALVE_INDEX_FILL:
894  return GetValvePressureLevelGauge(pValveIndex) >= 0.99;
895  break;
896  }
897 
898  return 0.0;
899  }
900 
901  protected float AdjustTime(float originalTime)
902  {
903  #ifdef DIAG_DEVELOPER
904  float timeAccel = 1;
905  if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_RESERVOIR))
906  {
907  timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
908  return originalTime * timeAccel;
909  }
910  #endif
911  return originalTime;
912  }
913 
914  protected vector GetMemoryPointPosition(string pMemoryPoint)
915  {
916  vector pos = vector.Zero;
917 
918  if (MemoryPointExists(pMemoryPoint))
919  {
920  pos = GetMemoryPointPos(pMemoryPoint);
921  pos = ModelToWorld(pos);
922  }
923  else
924  {
925  ErrorEx(string.Format("Memory point %1 not found, falling back to vector.Zero", pMemoryPoint));
926  }
927 
928  return pos;
929  }
930 
931  protected void HandleSoundEffects()
932  {
937  }
938 
939  protected void PlayValveManipulationSound()
940  {
941  switch (m_ValveManipulatedIndex)
942  {
943  case VALVE_INDEX_DRAIN:
945  break;
946  case VALVE_INDEX_FILL:
948  break;
949  }
950  }
951 
953  {
954  if (IsAnyValveActive())
955  {
957  {
960  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(PlayPipeCreakingSoundOnLocation, randomDelay, false);
961  }
962  }
963  else
964  {
966  {
967  StopSoundSet(m_PipeCreakingSounds);
968  m_PipeCreakingSounds = null;
969  }
970  }
971  }
972 
974  {
975  if (!m_PipeSounds || m_PipeSounds.Count() == 0)
976  {
977  return;
978  }
979 
980  EffectSound sndDrain, sndFill;
981  float drainPressureLevel = GetValvePressureLevelGauge(VALVE_INDEX_DRAIN);
982  if (drainPressureLevel >= 0.4 && drainPressureLevel < 0.8)
983  {
984  if (m_PipeSounds[VALVE_INDEX_DRAIN] == null)
985  {
986  PlaySoundSetAtMemoryPoint(sndDrain, SOUND_NAME_PIPE_SPRINKLING_START, VALVE_NAME_DRAIN, false, 0.0, 0.5);
987  m_PipeSounds[VALVE_INDEX_DRAIN] = sndDrain;
988  StopSoundSet(m_PipeSounds[VALVE_INDEX_DRAIN]);
990  PlaySoundSetAtMemoryPointLooped(sndDrain, SOUND_NAME_PIPE_SPRINKLING_LOOP1, VALVE_NAME_DRAIN, 0.5, 0.5);
991  m_PipeSounds[VALVE_INDEX_DRAIN] = sndDrain;
992  }
993  }
994 
995  if (drainPressureLevel < 0.4)
996  {
997  if (m_PipeSounds[VALVE_INDEX_DRAIN] != null)
998  {
999  StopSoundSet(m_PipeSounds[VALVE_INDEX_DRAIN]);
1001  }
1002  }
1003 
1005 
1006  float fillPressureLevel = GetValvePressureLevelGauge(VALVE_INDEX_FILL);
1007  if (fillPressureLevel >= 0.4)
1008  {
1009  if (m_PipeSounds[VALVE_INDEX_FILL] == null)
1010  {
1011  PlaySoundSetAtMemoryPoint(sndFill, SOUND_NAME_PIPE_SPRINKLING_START, VALVE_NAME_FILL, false, 0.0, 0.5);
1012  StopSoundSet(m_PipeSounds[VALVE_INDEX_FILL]);
1014  PlaySoundSetAtMemoryPointLooped(sndFill, SOUND_NAME_PIPE_SPRINKLING_LOOP2, VALVE_NAME_FILL, 0.5, 0.5);
1015  m_PipeSounds[VALVE_INDEX_FILL] = sndFill;
1016  }
1017  }
1018 
1019  if (fillPressureLevel < 0.4)
1020  {
1021  if (m_PipeSounds[VALVE_INDEX_FILL] != null)
1022  {
1023  StopSoundSet(m_PipeSounds[VALVE_INDEX_FILL]);
1025  }
1026  }
1027  }
1028 
1030  {
1033  {
1035  {
1036  if (m_PipeUnderwaterSound == null)
1037  {
1038  PlaySoundSetAtMemoryPoint(m_PipeUnderwaterSound, SOUND_NAME_UPIPE_SPRINKLING_START, PIPE_NAME_BROKEN1, false, 0.0, 0.5);
1039  StopSoundSet(m_PipeUnderwaterSound);
1040  m_PipeUnderwaterSound = null;
1041  m_PipeUnderwaterSoundRunning = PlaySoundSetAtMemoryPointLooped(m_PipeUnderwaterSound, SOUND_NAME_UPIPE_SPRINKLING_LOOP, PIPE_NAME_BROKEN1, 0.0, 0.5);
1042  }
1043  }
1045  {
1047  {
1048  StopSoundSet(m_PipeUnderwaterSound);
1049  if (m_PipeUnderwaterSoundRunning)
1050  {
1051  PlaySoundSetAtMemoryPoint(m_PipeUnderwaterSound, SOUND_NAME_UPIPE_SPRINKLING_END, PIPE_NAME_BROKEN1, false, 0.0, 0.5);
1052  m_PipeUnderwaterSoundRunning = false;
1053  }
1054  }
1055  }
1056  }
1057  }
1058 
1060  {
1062  {
1063  if (m_WaterLevelMovementSound == null)
1064  {
1065  PlaySoundSetAtMemoryPointLooped(m_WaterLevelMovementSound, SOUND_NAME_WATER_DRAIN_LOOP, PIPE_NAME_BROKEN1, 0.0, 0.5);
1066  }
1067  }
1069  {
1070  if (m_WaterLevelMovementSound == null)
1071  {
1072  PlaySoundSetAtMemoryPointLooped(m_WaterLevelMovementSound, SOUND_NAME_WATER_FILL_LOOP, PIPE_NAME_BROKEN1, 0.0, 0.5);
1073  }
1074  }
1076  {
1078  {
1079  StopSoundSet(m_WaterLevelMovementSound);
1080  }
1081  }
1082  }
1083 
1084  protected void CleanSoundEffects()
1085  {
1088  }
1089 
1091  {
1093  int index = Math.RandomInt(0, PIPE_CREAKING_SOUND_LOCATIONS_COUNT);
1095  }
1096 
1097  protected void HandleVisualEffects()
1098  {
1100  {
1101  if (m_ValveParticles[VALVE_INDEX_DRAIN] == null)
1102  {
1104  }
1105  }
1106 
1108  {
1109  if (m_ValveParticles[VALVE_INDEX_DRAIN] != null)
1110  {
1111  m_ValveParticles[VALVE_INDEX_DRAIN].StopParticle();
1113  }
1114  }
1115 
1117  {
1118  if (m_ValveParticles[VALVE_INDEX_FILL] == null)
1119  {
1121  }
1122  }
1123 
1125  {
1126  if (m_ValveParticles[VALVE_INDEX_FILL] != null)
1127  {
1128  m_ValveParticles[VALVE_INDEX_FILL].StopParticle();
1130  }
1131  }
1132 
1133 
1136  {
1138  {
1140  {
1142  }
1143 
1146  {
1147  m_PipeBrokenParticles[PIPE_INDEX_BROKEN2].StopParticle();
1149  }
1150  }
1151  }
1152 
1155  {
1157  {
1159  }
1160  }
1161 
1163  {
1164  for (int pipe = 0; pipe < m_PipeBrokenParticles.Count(); ++pipe)
1165  {
1166  if (m_PipeBrokenParticles[pipe])
1167  {
1168  m_PipeBrokenParticles[pipe].StopParticle();
1169  m_PipeBrokenParticles[pipe] = null;
1170  }
1171  }
1172  }
1173  }
1174 
1175  protected void CleanVisualEffects()
1176  {
1177  for (int valve = 0; valve < VALVES_COUNT; ++valve)
1178  {
1179  if (m_ValveParticles[valve])
1180  {
1181  m_ValveParticles[valve].StopParticle();
1182  m_ValveParticles[valve] = null;
1183  }
1184  }
1185 
1186  for (int pipe = 0; pipe < m_PipeBrokenParticles.Count(); ++pipe)
1187  {
1188  if (m_PipeBrokenParticles[pipe])
1189  {
1190  m_PipeBrokenParticles[pipe].StopParticle();
1191  m_PipeBrokenParticles[pipe] = null;
1192  }
1193  }
1194  }
1195 
1196 
1197 
1198  protected void ResetState()
1199  {
1200  SetWaterLevelHeight(m_WaterLevelsAvailable[WATER_LEVEL_AVERAGE][1]);
1207  m_ValveStates = {0, 0};
1208  m_PressureAnimationRequests = {0, 0};
1211  m_PressureTimesAccumulated = {0, 0};
1212  m_LastActiveValve = -1;
1217  SetSynchDirty();
1219  }
1220 
1221  protected void SyncValveVariables()
1222  {
1223  if (GetGame())
1224  {
1227  {
1229  SetSynchDirty();
1230  }
1231  }
1232  }
1233 
1235  {
1236  int packedBits = 0;
1237 
1238  for (int i = 0; i < pStates.Count(); ++i)
1239  {
1240  if (pStates[i] == true)
1241  {
1242  packedBits |= 1 << i;
1243  }
1244  }
1245 
1246  return packedBits;
1247  }
1248 
1249  protected array<bool> UnpackBitsToArrayOfBoolStates(int pPackedBits, int pArrayLength)
1250  {
1251  array<bool> unpackedBools = new array<bool>();
1252  for (int i = 0; i < pArrayLength; ++i)
1253  {
1254  if ((pPackedBits & 1 << i) != 0)
1255  {
1256  unpackedBools.Insert(true);
1257  }
1258  else
1259  {
1260  unpackedBools.Insert(false);
1261  }
1262  }
1263 
1264  return unpackedBools;
1265  }
1266 
1267 #ifdef DEVELOPER
1268  override protected string GetDebugText()
1269  {
1270  string debug_output = "";
1271  debug_output += string.Format("\nm_WaterLevelActual: %1", m_WaterLevelActual);
1272  debug_output += string.Format("\nm_WaterLevelPrev: %1", m_WaterLevelPrev);
1273  debug_output += string.Format("\nm_ValveManipulatedIndex: %1", m_ValveManipulatedIndex);
1274 
1275  int valve;
1276  for (valve = 0; valve < VALVES_COUNT; ++valve)
1277  {
1278  debug_output += string.Format("\nvalve %1 state:%2 | pressure req: %2", valve, m_ValveStates[valve], m_PressureAnimationRequests[valve]);
1279  }
1280 
1281  return debug_output;
1282  }
1283 
1284  override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
1285  {
1286  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SPECIALIZED_ACTION1, "Reset state", FadeColors.LIGHT_GREY));
1287  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SPECIALIZED_ACTION2, "Drain", FadeColors.LIGHT_GREY));
1288  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SPECIALIZED_ACTION3, "Fill", FadeColors.LIGHT_GREY));
1289  outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
1290 
1291  super.GetDebugActions(outputList);
1292  }
1293 
1294  override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
1295  {
1296  if (super.OnAction(action_id, player, ctx))
1297  return true;
1298  if (GetGame().IsServer() || !GetGame().IsMultiplayer())
1299  {
1300  if (action_id == EActions.SPECIALIZED_ACTION1)
1301  {
1302  ResetState();
1307  }
1308  else if (action_id == EActions.SPECIALIZED_ACTION2)
1309  {
1310  ResetState();
1316  }
1317  else if (action_id == EActions.SPECIALIZED_ACTION3)
1318  {
1319  ResetState();
1325  SetSynchDirty();
1326  }
1327  }
1328  return false;
1329  }
1330 
1331 
1332 #endif
1333 }
1334 
BuildingBase
void BuildingBase()
Definition: building.c:14
m_PressureAnimationRequests
protected ref array< bool > m_PressureAnimationRequests
Definition: land_underground_waterreservoir.c:117
GetGame
proto native CGame GetGame()
WATER_LEVELS_COUNT
const protected int WATER_LEVELS_COUNT
Definition: land_underground_waterreservoir.c:100
SOUND_NAME_PIPE_CREAKING
const protected string SOUND_NAME_PIPE_CREAKING
Definition: land_underground_waterreservoir.c:63
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
IsValvePressureLevelGaugeAtBase
protected bool IsValvePressureLevelGaugeAtBase(int pValveIndex)
Definition: land_underground_waterreservoir.c:886
m_WaterLevelSnapshot
protected ref WaterLevelSnapshot m_WaterLevelSnapshot
for deanimation purposes
Definition: land_underground_waterreservoir.c:87
m_ValveParticles
protected ref ParticleSourceArray m_ValveParticles
Definition: land_underground_waterreservoir.c:150
PIPE_NAME_LEAKING_FILL
const protected string PIPE_NAME_LEAKING_FILL
Definition: land_underground_waterreservoir.c:61
PARTICLE_FILL_PIPE_JET
const protected int PARTICLE_FILL_PIPE_JET
Definition: land_underground_waterreservoir.c:77
m_DrainValvePressureStageSettings
protected ref array< ref PressureLevelSettings > m_DrainValvePressureStageSettings
Definition: land_underground_waterreservoir.c:82
ActionTurnValveUndergroundReservoir
ActionUncoverHeadSelfCB ActionTurnValveUndergroundReservoir
ANIM_PHASE_VALVE_DRAIN
const protected string ANIM_PHASE_VALVE_DRAIN
Definition: land_underground_waterreservoir.c:54
INDEX_NOT_FOUND
const int INDEX_NOT_FOUND
Definition: gameplay.c:13
ResetState
protected void ResetState()
Definition: land_underground_waterreservoir.c:1198
m_WaterLevelHeightActual
protected float m_WaterLevelHeightActual
Definition: land_underground_waterreservoir.c:125
m_ValveStatesPackedPrev
protected int m_ValveStatesPackedPrev
Definition: land_underground_waterreservoir.c:109
CleanSoundEffects
protected void CleanSoundEffects()
Definition: land_underground_waterreservoir.c:1084
HeightToWaterLevel
protected int HeightToWaterLevel(float pHeight)
Definition: land_underground_waterreservoir.c:618
m_ValveManipulationSound
protected ref EffectSound m_ValveManipulationSound
Definition: land_underground_waterreservoir.c:129
SOUND_NAME_VALVE_MANIPULATION
const protected string SOUND_NAME_VALVE_MANIPULATION
Definition: land_underground_waterreservoir.c:64
PIPE_NAME_LEAKING_DRAIN
const protected string PIPE_NAME_LEAKING_DRAIN
Definition: land_underground_waterreservoir.c:60
PIPE_CREAKING_MAX_TIME_DELAY_MS
const protected int PIPE_CREAKING_MAX_TIME_DELAY_MS
Definition: land_underground_waterreservoir.c:141
GetTurnableValveIndex
override int GetTurnableValveIndex(int pComponentIndex)
Definition: land_underground_waterreservoir.c:468
m_FillValveWaterLevelStageIndex
protected int m_FillValveWaterLevelStageIndex
Definition: land_underground_waterreservoir.c:92
m_DrainValveWaterStageSettings
protected ref array< ref WaterLevelSettings > m_DrainValveWaterStageSettings
valve/pipe stages for water and pressure levels
Definition: land_underground_waterreservoir.c:81
m_DrainValvePressureLevelStageIndex
protected int m_DrainValvePressureLevelStageIndex
Definition: land_underground_waterreservoir.c:91
m_ValveManipulatedIndex
protected int m_ValveManipulatedIndex
Definition: land_underground_waterreservoir.c:110
m_FillValvePressureStageSettings
protected ref array< ref PressureLevelSettings > m_FillValvePressureStageSettings
Definition: land_underground_waterreservoir.c:85
m_PressureDeanimationRequests
protected ref array< bool > m_PressureDeanimationRequests
Definition: land_underground_waterreservoir.c:118
ANIM_PHASE_VALVE_GAUGE_FILL
const protected string ANIM_PHASE_VALVE_GAUGE_FILL
Definition: land_underground_waterreservoir.c:53
Duration
float Duration
Definition: land_underground_waterreservoir.c:16
SetActions
override void SetActions()
Definition: land_underground_waterreservoir.c:321
m_FillValvePressureDeanimationSettings
protected ref array< ref PressureLevelSettings > m_FillValvePressureDeanimationSettings
Definition: land_underground_waterreservoir.c:86
SOUND_NAME_PIPE_SPRINKLING_END
const protected string SOUND_NAME_PIPE_SPRINKLING_END
Definition: land_underground_waterreservoir.c:66
WL_AVERAGE
const protected int WL_AVERAGE
Definition: land_underground_waterreservoir.c:37
PreviousPressureLevelStageSettings
protected PressureLevelSettings PreviousPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
Definition: land_underground_waterreservoir.c:733
SOUND_NAME_WATER_FILL_LOOP
const protected string SOUND_NAME_WATER_FILL_LOOP
Definition: land_underground_waterreservoir.c:72
WaterLevelSettings
Definition: land_underground_waterreservoir.c:1
UnpackBitsToArrayOfBoolStates
protected array< bool > UnpackBitsToArrayOfBoolStates(int pPackedBits, int pArrayLength)
Definition: land_underground_waterreservoir.c:1249
m_PipeCreakingSounds
protected ref EffectSound m_PipeCreakingSounds
Definition: land_underground_waterreservoir.c:133
m_WaterLevelsAvailable
protected ref map< string, vector > m_WaterLevelsAvailable
Definition: land_underground_waterreservoir.c:114
Easing
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition: easing.c:2
ConfigureValvesAndGaugesCourse
protected void ConfigureValvesAndGaugesCourse()
Definition: land_underground_waterreservoir.c:410
WaterLevelToHeight
protected float WaterLevelToHeight(int pWaterLevel)
Definition: land_underground_waterreservoir.c:601
ErrorEx
enum ShapeType ErrorEx
IEntity
Definition: enentity.c:164
PlayValveManipulationSound
protected void PlayValveManipulationSound()
Definition: land_underground_waterreservoir.c:939
SetDefaultPressureLevelStageSettings
protected void SetDefaultPressureLevelStageSettings(int pValveIndex)
Definition: land_underground_waterreservoir.c:832
ActualPressureLevelStageSettings
protected PressureLevelSettings ActualPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
Definition: land_underground_waterreservoir.c:776
m_SpawnedWaterObject
protected Object m_SpawnedWaterObject
Definition: land_underground_waterreservoir.c:123
PIPE_INDEX_BROKEN2
const protected int PIPE_INDEX_BROKEN2
main broken pipe
Definition: land_underground_waterreservoir.c:50
HandleVisualEffects
protected void HandleVisualEffects()
Definition: land_underground_waterreservoir.c:1097
IsAnyValveActive
protected bool IsAnyValveActive()
Definition: land_underground_waterreservoir.c:450
SOUND_NAME_PIPE_SPRINKLING_START
const protected string SOUND_NAME_PIPE_SPRINKLING_START
Definition: land_underground_waterreservoir.c:65
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
ParticleSourceArray
array< ParticleSource > ParticleSourceArray
Definition: particlesource.c:103
m_FillValvePressureLevelStageIndex
protected int m_FillValvePressureLevelStageIndex
Definition: land_underground_waterreservoir.c:93
GetValvePressureLevelGauge
protected float GetValvePressureLevelGauge(int pValveIndex)
Definition: land_underground_waterreservoir.c:871
HandleSoundEffectsUnderwaterPipeSounds
protected void HandleSoundEffectsUnderwaterPipeSounds()
Definition: land_underground_waterreservoir.c:1029
SetWaterLevelHeight
protected void SetWaterLevelHeight(float pHeight)
Definition: land_underground_waterreservoir.c:560
m_PipeSounds
protected ref array< EffectSound > m_PipeSounds
Definition: land_underground_waterreservoir.c:130
m_WaterLevelDefault
protected vector m_WaterLevelDefault
Definition: land_underground_waterreservoir.c:124
PlayPipeCreakingSoundOnLocation
protected void PlayPipeCreakingSoundOnLocation()
Definition: land_underground_waterreservoir.c:1090
LateInit
protected void LateInit()
Definition: land_underground_waterreservoir.c:388
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
ActualWaterLevelStageSettings
protected WaterLevelSettings ActualWaterLevelStageSettings(int pValveIndex)
Definition: land_underground_waterreservoir.c:689
m_ValveManipulationSoundRequested
protected bool m_ValveManipulationSoundRequested
VFX/SFX.
Definition: land_underground_waterreservoir.c:128
ParticleList
Definition: particlelist.c:11
m_DrainValvePressureDeanimationSettings
protected ref array< ref PressureLevelSettings > m_DrainValvePressureDeanimationSettings
Definition: land_underground_waterreservoir.c:83
map
map
Definition: controlsxboxnew.c:3
m_ValveStates
protected ref array< bool > m_ValveStates
Definition: land_underground_waterreservoir.c:113
vector
Definition: enconvert.c:105
m_PipeUnderwaterSound
protected bool m_PipeUnderwaterSoundRunning protected ref EffectSound m_PipeUnderwaterSound
Definition: land_underground_waterreservoir.c:136
SOUND_NAME_UPIPE_SPRINKLING_LOOP
const protected string SOUND_NAME_UPIPE_SPRINKLING_LOOP
Definition: land_underground_waterreservoir.c:71
SetValvePressureLevelGauge
protected void SetValvePressureLevelGauge(int pValveIndex, float pValue)
Definition: land_underground_waterreservoir.c:858
HasTurnableValveBehavior
override bool HasTurnableValveBehavior()
Definition: land_underground_waterreservoir.c:328
VALVES_COUNT
const protected int VALVES_COUNT
Definition: land_underground_waterreservoir.c:44
m_ValveManipulatedIndexPrev
protected int m_ValveManipulatedIndexPrev
Definition: land_underground_waterreservoir.c:111
m_WaterLevelTimesAccumulated
protected ref array< float > m_WaterLevelTimesAccumulated
Definition: land_underground_waterreservoir.c:119
VALVE_INDEX_FILL
const protected int VALVE_INDEX_FILL
Definition: land_underground_waterreservoir.c:46
AdjustTime
protected float AdjustTime(float originalTime)
Definition: land_underground_waterreservoir.c:901
PARTICLE_FILL_PIPE_MAX_PRESSURE
const protected int PARTICLE_FILL_PIPE_MAX_PRESSURE
Definition: land_underground_waterreservoir.c:76
PIPE_INDEX_BROKEN1
const protected int PIPE_INDEX_BROKEN1
Definition: land_underground_waterreservoir.c:49
OBJECT_NAME_WATER_PLANE
class WaterLevelSnapshot OBJECT_NAME_WATER_PLANE
PressureLevel
class WaterLevelSettings PressureLevel
SyncValveVariables
protected void SyncValveVariables()
Definition: land_underground_waterreservoir.c:1221
PackArrayOfBoolStatesIntoBits
protected int PackArrayOfBoolStatesIntoBits(array< bool > pStates)
Definition: land_underground_waterreservoir.c:1234
m_ValveStatesPacked
protected int m_ValveStatesPacked
Definition: land_underground_waterreservoir.c:108
GetDebugText
string GetDebugText()
Definition: modifierbase.c:68
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
Object
Definition: objecttyped.c:1
PreviousWaterLevelStageSettings
protected WaterLevelSettings PreviousWaterLevelStageSettings(int pValveIndex)
Definition: land_underground_waterreservoir.c:655
PIPES_BROKEN_COUNT
const protected int PIPES_BROKEN_COUNT
Definition: land_underground_waterreservoir.c:48
PIPE_CREAKING_SOUND_LOCATIONS
const protected string PIPE_CREAKING_SOUND_LOCATIONS[PIPE_CREAKING_SOUND_LOCATIONS_COUNT]
Definition: land_underground_waterreservoir.c:143
HandleSoundEffectsPipeCreaking
protected void HandleSoundEffectsPipeCreaking()
Definition: land_underground_waterreservoir.c:952
GetDebugActions
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Definition: edible_base.c:744
PARTICLE_FILL_PIPE_JET_WEAK
const protected int PARTICLE_FILL_PIPE_JET_WEAK
Definition: land_underground_waterreservoir.c:78
m_ValveNames
protected ref array< string > m_ValveNames
Definition: land_underground_waterreservoir.c:112
GetMemoryPointPosition
protected vector GetMemoryPointPosition(string pMemoryPoint)
Definition: land_underground_waterreservoir.c:914
m_FillValveWaterStageSettings
protected ref array< ref WaterLevelSettings > m_FillValveWaterStageSettings
for deanimation purposes
Definition: land_underground_waterreservoir.c:84
OnValveManipulationCanceled
void OnValveManipulationCanceled(int pValveIndex)
Definition: land_underground_waterreservoir.c:520
VALVE_NAME_FILL
const protected string VALVE_NAME_FILL
Definition: land_underground_waterreservoir.c:57
VALVE_NAME_DRAIN
const protected string VALVE_NAME_DRAIN
Definition: land_underground_waterreservoir.c:56
PressureLevelToValue
protected float PressureLevelToValue(int pPressureLevel)
Definition: land_underground_waterreservoir.c:640
GetValveAligningPointsWS
array< vector > GetValveAligningPointsWS(int pValveIndex)
Definition: land_underground_waterreservoir.c:532
OnValveManipulationEnd
void OnValveManipulationEnd(int pValveIndex)
Definition: land_underground_waterreservoir.c:492
m_DrainValveWaterLevelStageIndex
protected int m_DrainValveWaterLevelStageIndex
pointing to specific stage for each valve/pipe
Definition: land_underground_waterreservoir.c:90
EActions
EActions
Definition: eactions.c:1
PIPE_CREAKING_MIN_TIME_DELAY_MS
const protected int PIPE_CREAKING_MIN_TIME_DELAY_MS
Definition: land_underground_waterreservoir.c:140
OnValveManipulationStart
void OnValveManipulationStart(int pValveIndex)
Definition: land_underground_waterreservoir.c:482
VALVE_INDEX_DRAIN
const protected int VALVE_INDEX_DRAIN
Definition: land_underground_waterreservoir.c:45
OnAction
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Definition: edible_base.c:755
PIPE_NAME_BROKEN1
const protected string PIPE_NAME_BROKEN1
Definition: land_underground_waterreservoir.c:58
WATER_LEVELS
const protected string WATER_LEVELS[WATER_LEVELS_COUNT]
Definition: land_underground_waterreservoir.c:101
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
~Land_Underground_WaterReservoir
void ~Land_Underground_WaterReservoir()
Definition: land_underground_waterreservoir.c:160
HandleSoundEffects
protected void HandleSoundEffects()
Definition: land_underground_waterreservoir.c:931
PressureLevelSettings
void PressureLevelSettings(int pPressureLevel, float pDuration)
Definition: land_underground_waterreservoir.c:18
SOUND_NAME_UPIPE_SPRINKLING_END
const protected string SOUND_NAME_UPIPE_SPRINKLING_END
Definition: land_underground_waterreservoir.c:70
CleanVisualEffects
protected void CleanVisualEffects()
Definition: land_underground_waterreservoir.c:1175
EOnPostSimulate
override void EOnPostSimulate(IEntity other, float timeSlice)
Definition: land_underground_waterreservoir.c:166
SOUND_NAME_PIPE_SPRINKLING_LOOP2
const protected string SOUND_NAME_PIPE_SPRINKLING_LOOP2
Definition: land_underground_waterreservoir.c:68
AnimateValve
protected void AnimateValve(int pValveIndex, float pPhase)
Definition: land_underground_waterreservoir.c:845
m_PipeBrokenParticles
protected ref ParticleSourceArray m_PipeBrokenParticles
Definition: land_underground_waterreservoir.c:151
SetLastActiveValve
protected void SetLastActiveValve(int pValveIndex)
Definition: land_underground_waterreservoir.c:555
PL_MAX
const protected int PL_MAX
Definition: land_underground_waterreservoir.c:42
Land_Underground_WaterReservoir
void Land_Underground_WaterReservoir()
Definition: land_underground_waterreservoir.c:153
HandleSoundEffectsPipeSprinkling
protected void HandleSoundEffectsPipeSprinkling()
Definition: land_underground_waterreservoir.c:973
SOUND_NAME_PIPE_SPRINKLING_LOOP1
const protected string SOUND_NAME_PIPE_SPRINKLING_LOOP1
Definition: land_underground_waterreservoir.c:67
SOUND_NAME_WATER_DRAIN_LOOP
const protected string SOUND_NAME_WATER_DRAIN_LOOP
Definition: land_underground_waterreservoir.c:73
WL_MIN
const protected int WL_MIN
Definition: land_underground_waterreservoir.c:35
Land_Underground_WaterReservoir_Water
Definition: land_underground_waterreservoir.c:1335
m_LastActiveValve
protected int m_LastActiveValve
Definition: land_underground_waterreservoir.c:121
OnVariablesSynchronized
override void OnVariablesSynchronized()
Definition: land_underground_waterreservoir.c:308
m_PressureTimesAccumulated
protected ref array< float > m_PressureTimesAccumulated
Definition: land_underground_waterreservoir.c:120
m_WaterLevelMovementSound
protected ref EffectSound m_WaterLevelMovementSound
Definition: land_underground_waterreservoir.c:138
PIPE_CREAKING_SOUND_LOCATIONS_COUNT
const protected int PIPE_CREAKING_SOUND_LOCATIONS_COUNT
Definition: land_underground_waterreservoir.c:142
PL_AVERAGE
const protected int PL_AVERAGE
Definition: land_underground_waterreservoir.c:41
ECE_CREATEPHYSICS
const int ECE_CREATEPHYSICS
Definition: centraleconomy.c:16
PARTICLE_DRAIN_PIPE_MAX_PRESSURE
const protected int PARTICLE_DRAIN_PIPE_MAX_PRESSURE
Definition: land_underground_waterreservoir.c:75
TranslateMemoryPointsToWaterLevels
protected void TranslateMemoryPointsToWaterLevels()
Definition: land_underground_waterreservoir.c:586
IsValveActive
protected bool IsValveActive(int pValveIndex)
Definition: land_underground_waterreservoir.c:463
WaterLevelSnapshot
Definition: land_underground_waterreservoir.c:25
SAT_DEBUG_ACTION
const int SAT_DEBUG_ACTION
Definition: constants.c:424
AdvanceToNextPressureLevelStageSettings
protected void AdvanceToNextPressureLevelStageSettings(int pValveIndex)
Definition: land_underground_waterreservoir.c:805
AdvanceToNextWaterLevelStageSettings
protected void AdvanceToNextWaterLevelStageSettings(int pValveIndex)
Definition: land_underground_waterreservoir.c:706
PL_MIN
const protected int PL_MIN
Definition: land_underground_waterreservoir.c:40
PIPE_NAME_BROKEN2
const protected string PIPE_NAME_BROKEN2
Definition: land_underground_waterreservoir.c:59
m_WaterLevelActual
protected int m_WaterLevelActual
Definition: land_underground_waterreservoir.c:115
Math
Definition: enmath.c:6
IsValveTurnable
override bool IsValveTurnable(int pValveIndex)
Definition: land_underground_waterreservoir.c:445
ANIM_PHASE_VALVE_FILL
const protected string ANIM_PHASE_VALVE_FILL
Definition: land_underground_waterreservoir.c:55
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition: particlemanager.c:84
EntityEvent
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition: enentity.c:44
TSelectableActionInfoWithColor
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition: entityai.c:97
m_WaterLevelPrev
protected int m_WaterLevelPrev
Definition: land_underground_waterreservoir.c:116
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
m_PipeCreakingSoundRequested
protected bool m_PipeCreakingSoundRequested
Definition: land_underground_waterreservoir.c:132
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
HandleSoundEffectsWaterLevelMovementSounds
protected void HandleSoundEffectsWaterLevelMovementSounds()
Definition: land_underground_waterreservoir.c:1059
WL_ABOVE_PIPES
const protected int WL_ABOVE_PIPES
Definition: land_underground_waterreservoir.c:36
RegisterValve
protected void RegisterValve(string pCompName, int pIndex)
Definition: land_underground_waterreservoir.c:575
WL_MAX
const protected int WL_MAX
Definition: land_underground_waterreservoir.c:38
Init
protected void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Definition: land_underground_waterreservoir.c:333
SOUND_NAME_UPIPE_SPRINKLING_START
const protected string SOUND_NAME_UPIPE_SPRINKLING_START
Definition: land_underground_waterreservoir.c:69
GetOrientation
vector GetOrientation()
Definition: areadamagemanager.c:306
ANIM_PHASE_VALVE_GAUGE_DRAIN
const protected string ANIM_PHASE_VALVE_GAUGE_DRAIN
tighter broken pipe
Definition: land_underground_waterreservoir.c:52