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"
191 float waterHeight, pressureLevel;
220 if (wlStageSettings.
Duration == -1.0)
230 float adjustedDuration = wlStageSettings.
Duration;
239 float start = adjustedWaterHeight;
260 int allValvesStates = 0;
272 if (plStageSettings.Duration == -1.0)
312 if (allValvesStates ==
false)
321 super.OnVariablesSynchronized();
391 RegisterNetSyncVariableInt(
"m_ValveStatesPacked", 0);
392 RegisterNetSyncVariableInt(
"m_ValveManipulatedIndex", -1,
VALVES_COUNT - 1);
393 RegisterNetSyncVariableInt(
"m_WaterLevelActual",
WL_MIN,
WL_MAX);
394 RegisterNetSyncVariableInt(
"m_WaterLevelPrev",
WL_MIN,
WL_MAX);
421 g_Game.RegisterNetworkStaticObject(
this);
485 string targetedValveName = GetActionComponentName(pComponentIndex);
564 valvePositions.Insert(posPoint);
565 valvePositions.Insert(dirPoint);
567 return valvePositions;
657 switch (pPressureLevel)
701 return wlStageSettings;
718 return wlStageSettings;
755 if (pDeanimationRequest)
758 return plStageSettings;
771 if (pDeanimationRequest)
774 return plStageSettings;
788 return plStageSettings;
798 if (pDeanimationRequest)
801 return plStageSettings;
807 if (pDeanimationRequest)
810 return plStageSettings;
817 return plStageSettings;
918 #ifdef DIAG_DEVELOPER
920 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_RESERVOIR))
922 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
923 return originalTime * timeAccel;
933 if (MemoryPointExists(pMemoryPoint))
935 pos = GetMemoryPointPos(pMemoryPoint);
936 pos = ModelToWorld(pos);
940 ErrorEx(
string.Format(
"Memory point %1 not found, falling back to vector.Zero", pMemoryPoint));
999 if (drainPressureLevel >= 0.4 && drainPressureLevel < 0.8)
1013 if (drainPressureLevel < 0.4)
1026 if (fillPressureLevel >= 0.4)
1039 if (fillPressureLevel < 0.4)
1070 if (m_PipeUnderwaterSoundRunning)
1073 m_PipeUnderwaterSoundRunning =
false;
1259 for (
int i = 0; i < pStates.Count(); ++i)
1261 if (pStates[i] ==
true)
1263 packedBits |= 1 << i;
1273 for (
int i = 0; i < pArrayLength; ++i)
1275 if ((pPackedBits & 1 << i) != 0)
1277 unpackedBools.Insert(
true);
1281 unpackedBools.Insert(
false);
1285 return unpackedBools;
1291 string debug_output =
"";
1302 return debug_output;
1305 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
1312 super.GetDebugActions(outputList);
1317 if (super.OnAction(action_id, player, ctx))
1321 if (action_id ==
EActions.SPECIALIZED_ACTION1)
1329 else if (action_id ==
EActions.SPECIALIZED_ACTION2)
1338 else if (action_id ==
EActions.SPECIALIZED_ACTION3)
Param4< int, int, string, int > TSelectableActionInfoWithColor
ActionTurnValveUndergroundReservoirCB ActionTurnValveCB ActionTurnValveUndergroundReservoir()
void AddAction(typename actionName)
const int ECE_CREATEPHYSICS
override void OnVariablesSynchronized()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
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
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.
Keffiyeh_LightBlue SetActions
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.