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"
189 float waterHeight, pressureLevel;
218 if (wlStageSettings.
Duration == -1.0)
228 float adjustedDuration = wlStageSettings.
Duration;
237 float start = adjustedWaterHeight;
258 int allValvesStates = 0;
270 if (plStageSettings.Duration == -1.0)
310 if (allValvesStates ==
false)
319 super.OnVariablesSynchronized();
389 RegisterNetSyncVariableInt(
"m_ValveStatesPacked", 0);
390 RegisterNetSyncVariableInt(
"m_ValveManipulatedIndex", -1,
VALVES_COUNT - 1);
391 RegisterNetSyncVariableInt(
"m_WaterLevelActual",
WL_MIN,
WL_MAX);
392 RegisterNetSyncVariableInt(
"m_WaterLevelPrev",
WL_MIN,
WL_MAX);
419 g_Game.RegisterNetworkStaticObject(
this);
483 string targetedValveName = GetActionComponentName(pComponentIndex);
562 valvePositions.Insert(posPoint);
563 valvePositions.Insert(dirPoint);
565 return valvePositions;
655 switch (pPressureLevel)
699 return wlStageSettings;
716 return wlStageSettings;
753 if (pDeanimationRequest)
756 return plStageSettings;
769 if (pDeanimationRequest)
772 return plStageSettings;
786 return plStageSettings;
796 if (pDeanimationRequest)
799 return plStageSettings;
805 if (pDeanimationRequest)
808 return plStageSettings;
815 return plStageSettings;
916 #ifdef DIAG_DEVELOPER
918 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_RESERVOIR))
920 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
921 return originalTime * timeAccel;
931 if (MemoryPointExists(pMemoryPoint))
933 pos = GetMemoryPointPos(pMemoryPoint);
934 pos = ModelToWorld(pos);
938 ErrorEx(
string.Format(
"Memory point %1 not found, falling back to vector.Zero", pMemoryPoint));
997 if (drainPressureLevel >= 0.4 && drainPressureLevel < 0.8)
1011 if (drainPressureLevel < 0.4)
1024 if (fillPressureLevel >= 0.4)
1037 if (fillPressureLevel < 0.4)
1068 if (m_PipeUnderwaterSoundRunning)
1071 m_PipeUnderwaterSoundRunning =
false;
1257 for (
int i = 0; i < pStates.Count(); ++i)
1259 if (pStates[i] ==
true)
1261 packedBits |= 1 << i;
1271 for (
int i = 0; i < pArrayLength; ++i)
1273 if ((pPackedBits & 1 << i) != 0)
1275 unpackedBools.Insert(
true);
1279 unpackedBools.Insert(
false);
1283 return unpackedBools;
1289 string debug_output =
"";
1300 return debug_output;
1303 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
1310 super.GetDebugActions(outputList);
1315 if (super.OnAction(action_id, player, ctx))
1319 if (action_id ==
EActions.SPECIALIZED_ACTION1)
1327 else if (action_id ==
EActions.SPECIALIZED_ACTION2)
1336 else if (action_id ==
EActions.SPECIALIZED_ACTION3)
Param4< int, int, string, int > TSelectableActionInfoWithColor
ActionTurnValveUndergroundReservoirCB ActionTurnValveCB ActionTurnValveUndergroundReservoir()
const int ECE_CREATEPHYSICS
override void OnVariablesSynchronized()
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)
int m_ValveManipulatedIndexPrev
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
ref Timer m_TempHotfixTimer
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 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
void HandleSoundEffects()
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)
float AdjustTime(float originalTime)
const string SOUND_NAME_UPIPE_SPRINKLING_START
const string PIPE_NAME_BROKEN2
void SyncValveVariables()
const string SOUND_NAME_UPIPE_SPRINKLING_END
int m_ValveStatesPackedPrev
int HeightToWaterLevel(float pHeight)
ref array< float > m_WaterLevelTimesAccumulated
void TranslateMemoryPointsToWaterLevels()
int m_ValveManipulatedIndex
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 string SOUND_NAME_UPIPE_SPRINKLING_LOOP
ref EffectSound m_PipeCreakingSounds
static const string WATER_LEVEL_AVERAGE
vector m_WaterLevelDefault
const string ANIM_PHASE_VALVE_GAUGE_DRAIN
tighter broken pipe
void PlayValveManipulationSound()
void PressureLevelSettings(int pPressureLevel, float pDuration)
void CleanVisualEffects()
const int PIPE_CREAKING_MAX_TIME_DELAY_MS
const float TEMP_HOTIX_TIMESLICE
void ConfigureValvesAndGaugesCourse()
vector GetMemoryPointPosition(string pMemoryPoint)
void HandleVisualEffects()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
array< ParticleSource > ParticleSourceArray
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
void AddAction(typename actionName)
static float EaseInOutSine(float t)
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Wrapper class for managing sound through SEffectManager.
static const int WATER_JET
static const int WATER_JET_WEAK
static const int WATER_SPILLING
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
Manager class for managing Effect (EffectParticle, EffectSound)
void WaterLevelSettings(int pWaterLevel, float pDuration)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const int INDEX_NOT_FOUND
Serializer ParamsReadContext
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 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
proto void Insert(int index, string input)
Inserts a string into the n-th index, increasing the string length by the size of the input.
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.