135 protected bool m_PipeUnderwaterSoundRunning
144 "pipe_creaking_sound_pos_1",
145 "pipe_creaking_sound_pos_2",
146 "pipe_creaking_sound_pos_3",
147 "pipe_creaking_sound_pos_4"
179 float waterHeight, pressureLevel;
208 if (wlStageSettings.
Duration == -1.0)
218 float adjustedDuration = wlStageSettings.
Duration;
227 float start = adjustedWaterHeight;
249 int allValvesStates = 0;
261 if (plStageSettings.Duration == -1.0)
301 if (allValvesStates ==
false)
310 super.OnVariablesSynchronized();
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);
470 string targetedValveName = GetActionComponentName(pComponentIndex);
549 valvePositions.Insert(posPoint);
550 valvePositions.Insert(dirPoint);
552 return valvePositions;
642 switch (pPressureLevel)
686 return wlStageSettings;
703 return wlStageSettings;
740 if (pDeanimationRequest)
743 return plStageSettings;
756 if (pDeanimationRequest)
759 return plStageSettings;
773 return plStageSettings;
783 if (pDeanimationRequest)
786 return plStageSettings;
792 if (pDeanimationRequest)
795 return plStageSettings;
802 return plStageSettings;
903 #ifdef DIAG_DEVELOPER
905 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_RESERVOIR))
907 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
908 return originalTime * timeAccel;
918 if (MemoryPointExists(pMemoryPoint))
920 pos = GetMemoryPointPos(pMemoryPoint);
921 pos = ModelToWorld(pos);
925 ErrorEx(
string.Format(
"Memory point %1 not found, falling back to vector.Zero", pMemoryPoint));
982 if (drainPressureLevel >= 0.4 && drainPressureLevel < 0.8)
995 if (drainPressureLevel < 0.4)
1007 if (fillPressureLevel >= 0.4)
1019 if (fillPressureLevel < 0.4)
1049 if (m_PipeUnderwaterSoundRunning)
1052 m_PipeUnderwaterSoundRunning =
false;
1238 for (
int i = 0; i < pStates.Count(); ++i)
1240 if (pStates[i] ==
true)
1242 packedBits |= 1 << i;
1252 for (
int i = 0; i < pArrayLength; ++i)
1254 if ((pPackedBits & 1 << i) != 0)
1256 unpackedBools.Insert(
true);
1260 unpackedBools.Insert(
false);
1264 return unpackedBools;
1270 string debug_output =
"";
1281 return debug_output;
1284 override void GetDebugButtonNames(out
string button1, out
string button2, out
string button3, out
string button4)
1286 button1 =
"Reset state";
1293 switch (button_index)
ActionTurnValveUndergroundReservoirCB ActionTurnValveCB ActionTurnValveUndergroundReservoir()
void AddAction(typename actionName)
const int ECE_CREATEPHYSICS
override void OnDebugButtonPressServer(int button_index)
override void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
override void OnVariablesSynchronized()
protected float PressureLevelToValue(int pPressureLevel)
protected void ConfigureValvesAndGaugesCourse()
override void EOnPostSimulate(IEntity other, float timeSlice)
protected ref array< ref PressureLevelSettings > m_DrainValvePressureDeanimationSettings
protected void AdvanceToNextWaterLevelStageSettings(int pValveIndex)
protected void TranslateMemoryPointsToWaterLevels()
protected ref array< bool > m_ValveStates
protected const string SOUND_NAME_WATER_DRAIN_LOOP
protected const string ANIM_PHASE_VALVE_GAUGE_FILL
protected const string SOUND_NAME_PIPE_SPRINKLING_LOOP1
protected int m_FillValveWaterLevelStageIndex
protected const int PL_MIN
protected void PlayPipeCreakingSoundOnLocation()
protected PressureLevelSettings PreviousPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
protected const int PL_MAX
protected WaterLevelSettings ActualWaterLevelStageSettings(int pValveIndex)
protected int m_ValveStatesPacked
override bool HasTurnableValveBehavior()
protected int m_ValveStatesPackedPrev
protected const int WL_ABOVE_PIPES
protected ref WaterLevelSnapshot m_WaterLevelSnapshot
for deanimation purposes
protected const string SOUND_NAME_UPIPE_SPRINKLING_START
protected void HandleSoundEffects()
protected void AdvanceToNextPressureLevelStageSettings(int pValveIndex)
protected const int PIPES_BROKEN_COUNT
protected ref array< bool > m_PressureDeanimationRequests
protected const int PL_AVERAGE
protected const string ANIM_PHASE_VALVE_FILL
protected int m_ValveManipulatedIndex
protected const int PIPE_CREAKING_MIN_TIME_DELAY_MS
protected void SetLastActiveValve(int pValveIndex)
protected PressureLevelSettings ActualPressureLevelStageSettings(int pValveIndex, bool pDeanimationRequest=false)
protected const string VALVE_NAME_FILL
protected int m_WaterLevelActual
protected ref ParticleSourceArray m_ValveParticles
protected ref map< string, vector > m_WaterLevelsAvailable
protected const int WL_MAX
protected bool IsAnyValveActive()
void OnValveManipulationStart(int pValveIndex)
protected const int PARTICLE_FILL_PIPE_MAX_PRESSURE
protected const string PIPE_NAME_LEAKING_DRAIN
protected const string SOUND_NAME_PIPE_SPRINKLING_END
protected const int PARTICLE_FILL_PIPE_JET
class WaterLevelSettings PressureLevel
protected const string VALVE_NAME_DRAIN
protected void SyncValveVariables()
protected WaterLevelSettings PreviousWaterLevelStageSettings(int pValveIndex)
protected bool m_PipeCreakingSoundRequested
protected const string PIPE_NAME_LEAKING_FILL
protected float GetValvePressureLevelGauge(int pValveIndex)
protected void HandleSoundEffectsWaterLevelMovementSounds()
protected void CleanVisualEffects()
protected void HandleSoundEffectsPipeCreaking()
protected const int PARTICLE_DRAIN_PIPE_MAX_PRESSURE
static protected const string WATER_LEVEL_AVERAGE
static protected const string WATER_LEVEL_MIN
protected void SetDefaultPressureLevelStageSettings(int pValveIndex)
void OnValveManipulationEnd(int pValveIndex)
protected const string PIPE_CREAKING_SOUND_LOCATIONS[PIPE_CREAKING_SOUND_LOCATIONS_COUNT]
protected const int VALVE_INDEX_DRAIN
protected bool m_PipeUnderwaterSoundRunning protected ref EffectSound m_PipeUnderwaterSound
protected const string ANIM_PHASE_VALVE_DRAIN
protected array< bool > UnpackBitsToArrayOfBoolStates(int pPackedBits, int pArrayLength)
protected const string SOUND_NAME_VALVE_MANIPULATION
protected const string PIPE_NAME_BROKEN1
protected int m_DrainValveWaterLevelStageIndex
pointing to specific stage for each valve/pipe
static protected const string WATER_LEVEL_ABOVE_PIPES
void Land_Underground_WaterReservoir()
array< vector > GetValveAligningPointsWS(int pValveIndex)
protected ref EffectSound m_ValveManipulationSound
protected const int PIPE_INDEX_BROKEN2
main broken pipe
protected const int WL_MIN
protected int PackArrayOfBoolStatesIntoBits(array< bool > pStates)
protected const int VALVE_INDEX_FILL
protected ref array< ref PressureLevelSettings > m_DrainValvePressureStageSettings
protected ref array< string > m_ValveNames
void OnValveManipulationCanceled(int pValveIndex)
protected ref array< ref WaterLevelSettings > m_FillValveWaterStageSettings
for deanimation purposes
protected const int PIPE_CREAKING_SOUND_LOCATIONS_COUNT
protected ref array< ref PressureLevelSettings > m_FillValvePressureDeanimationSettings
protected int m_ValveManipulatedIndexPrev
protected float WaterLevelToHeight(int pWaterLevel)
protected void RegisterValve(string pCompName, int pIndex)
protected Object m_SpawnedWaterObject
override bool IsValveTurnable(int pValveIndex)
protected ref EffectSound m_PipeCreakingSounds
protected int m_WaterLevelPrev
protected void LateInit()
protected bool m_ValveManipulationSoundRequested
VFX/SFX.
void ~Land_Underground_WaterReservoir()
protected bool IsValvePressureLevelGaugeAtBase(int pValveIndex)
protected float m_WaterLevelHeightActual
protected void HandleSoundEffectsPipeSprinkling()
protected bool IsValveActive(int pValveIndex)
protected const int WL_AVERAGE
protected const string PIPE_NAME_BROKEN2
protected const string WATER_LEVELS[WATER_LEVELS_COUNT]
protected const string SOUND_NAME_PIPE_CREAKING
override int GetTurnableValveIndex(int pComponentIndex)
protected const int PARTICLE_FILL_PIPE_JET_WEAK
protected void SetWaterLevelHeight(float pHeight)
protected ref array< float > m_WaterLevelTimesAccumulated
protected const string SOUND_NAME_PIPE_SPRINKLING_START
protected void CleanSoundEffects()
protected const int PIPE_CREAKING_MAX_TIME_DELAY_MS
protected ref array< float > m_PressureTimesAccumulated
protected vector GetMemoryPointPosition(string pMemoryPoint)
protected void HandleSoundEffectsUnderwaterPipeSounds()
protected int HeightToWaterLevel(float pHeight)
protected const string SOUND_NAME_PIPE_SPRINKLING_LOOP2
protected const int PIPE_INDEX_BROKEN1
protected const string ANIM_PHASE_VALVE_GAUGE_DRAIN
tighter broken pipe
protected void ResetState()
protected const string SOUND_NAME_UPIPE_SPRINKLING_END
static protected const string WATER_LEVEL_MAX
protected void SetValvePressureLevelGauge(int pValveIndex, float pValue)
protected const int WATER_LEVELS_COUNT
protected const int VALVES_COUNT
protected void AnimateValve(int pValveIndex, float pPhase)
protected int m_DrainValvePressureLevelStageIndex
protected void PlayValveManipulationSound()
protected vector m_WaterLevelDefault
protected int m_LastActiveValve
protected float AdjustTime(float originalTime)
class WaterLevelSnapshot OBJECT_NAME_WATER_PLANE
protected ref array< bool > m_PressureAnimationRequests
protected ref array< ref PressureLevelSettings > m_FillValvePressureStageSettings
protected const string SOUND_NAME_WATER_FILL_LOOP
protected ref array< ref WaterLevelSettings > m_DrainValveWaterStageSettings
valve/pipe stages for water and pressure levels
void PressureLevelSettings(int pPressureLevel, float pDuration)
protected void HandleVisualEffects()
protected ref EffectSound m_WaterLevelMovementSound
protected ref ParticleSourceArray m_PipeBrokenParticles
protected const string SOUND_NAME_UPIPE_SPRINKLING_LOOP
protected int m_FillValvePressureLevelStageIndex
protected ref array< EffectSound > m_PipeSounds
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
array< ParticleSource > ParticleSourceArray
proto native bool RegisterNetworkStaticObject(Object object)
Static objects cannot be replicated by default (there are too many objects on the map)....
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
override ScriptCallQueue GetCallQueue(int call_category)
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
static float EaseInOutSine(float t)
Wrapper class for managing sound through SEffectManager.
static const int WATER_JET_WEAK
static const int WATER_JET
static const int WATER_SPILLING
Manager class for managing Effect (EffectParticle, EffectSound)
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
void WaterLevelSettings(int pWaterLevel, float pDuration)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const int INDEX_NOT_FOUND
proto native CGame GetGame()
EntityEvent
Entity events for event-mask, or throwing event from code.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
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 float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.