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 GetGame().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)
291 if (animSource.Contains(
"lever"))
310 return closestBunker;
312 float smallestDist =
float.MAX;
320 float dist =
vector.DistanceSq(bunker.GetPosition(),thisPos);
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 AnimateLever(int index, int state=-1)
static void UnregisterBunker(Land_WarheadStorage_Main bunker)
override void DeferredInit()
const string SPARKLES_SOUND
override void OnAnimationPhaseStarted(string animSource, float phase)
string GetLeverComponentNameByLeverIndex(int leverIndex)
PowerGeneratorStatic GetPowerGenerator()
const string GENERATOR_POS_MEMPOINT
override void OnVariablesSynchronized()
static ref map< Land_WarheadStorage_PowerStation, Land_WarheadStorage_Main > m_BunkerStationMap
Land_WarheadStorage_Main GetClosestBunker()
const string LEVERS_POS_MEMPOINT
void Land_WarheadStorage_PowerStation()
PowerGeneratorStatic m_PowerGenerator
void UpdateLeverStatesServer()
const string SWITCH_DOWN_SOUND
int GetLeverIndexByComponentName(string name)
void DebugPrepareGenerator()
vector GetPowerGeneratorSpawnPos()
void LinkPowerGeneratorServer()
const string SWITCH_UP_SOUND
void PlayLeverSound(string leverName, int state)
int m_LastActivatedLeverId
static void RegisterBunker(Land_WarheadStorage_Main bunker)
bool m_IsPowerGeneratorRunning
static ref set< Land_WarheadStorage_Main > m_Bunkers
void SetParent(Land_WarheadStorage_PowerStation parent)
static PowerGeneratorStatic GetClosestGenerator(vector position, float tolerance)
void StoreLeverStates(int leverStateBits)
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.
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)