4 protected static ref set<Land_WarheadStorage_Main>
m_Bunkers;
19 protected const string SPARKLES_SOUND =
"Power_Station_generator_overpowered_SoundSet";
25 RegisterNetSyncVariableInt(
"m_PlaySparks", 0, 4);
33 g_Game.RegisterNetworkStaticObject(
this);
38 super.OnVariablesSynchronized();
43 string mempoint =
"lever" +
m_PlaySparks.ToString() +
"_sparks_pos";
56 return ModelToWorld(generatorPosLocal);
99 float animPhase = state;
103 if (GetAnimationPhase(leverName) > 0)
109 SetAnimationPhase(leverName, animPhase);
141 bool updated =
false;
142 for (
int index = 1; index <= 4; index++)
145 int bit = 1 << (index - 1);
156 else if (animPhase == 1)
206 for (
int i = 1; i < 5; i++)
209 if (GetAnimationPhase(leverName) > 0)
310 return closestBunker;
312 float smallestDist =
float.MAX;
321 if (dist < smallestDist)
323 closestBunker = bunker;
338 return closestBunker;
345 m_Bunkers =
new set<Land_WarheadStorage_Main>();
361 ErrorEx(
"Attempted to unregister non-registered bunker");
380 for (
int index = 1; index <= 4; index++)
382 int bit = 1 << (index - 1);
384 if ( (bit & leverBits) != 0 )
const int ECE_UPDATEPATHGRAPH
const int ECE_CREATEPHYSICS
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
void SetLeverStatesServer(int leverBits)
void SetPowerServer(bool hasPower)
void PlayLeverSound(string leverName, int state)
Land_WarheadStorage_Main GetClosestBunker()
static void UnregisterBunker(Land_WarheadStorage_Main bunker)
PowerGeneratorStatic GetPowerGenerator()
const string LEVERS_POS_MEMPOINT
override void DeferredInit()
void Land_WarheadStorage_PowerStation()
const string SPARKLES_SOUND
vector GetPowerGeneratorSpawnPos()
int GetLeverIndexByComponentName(string name)
const string SWITCH_DOWN_SOUND
bool m_IsPowerGeneratorRunning
void DebugPrepareGenerator()
static void RegisterBunker(Land_WarheadStorage_Main bunker)
int m_LastActivatedLeverId
void AnimateLever(int index, int state=-1)
static ref set< Land_WarheadStorage_Main > m_Bunkers
const string GENERATOR_POS_MEMPOINT
string GetLeverComponentNameByLeverIndex(int leverIndex)
void UpdateLeverStatesServer()
const string SWITCH_UP_SOUND
void LinkPowerGeneratorServer()
PowerGeneratorStatic m_PowerGenerator
override void OnVariablesSynchronized()
static ref map< Land_WarheadStorage_PowerStation, Land_WarheadStorage_Main > m_BunkerStationMap
override void OnAnimationPhaseStarted(string animSource, float phase)
static const int LEVER_SPARKS
static PowerGeneratorStatic GetClosestGenerator(vector position, float tolerance)
Manager class for managing Effect (EffectParticle, EffectSound).
static EffectSound PlaySoundCachedParams(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, using or creating cached SoundParams.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static proto int GetNumberOfSetBits(int i)
returns the number of bits set in a bitmask i
vector GetPosition()
Get the world position of the Effect.
bool Contains(string sample)
Returns true if sample is substring of string.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor).