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);
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
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
proto native bool RegisterNetworkStaticObject(Object object)
Static objects cannot be replicated by default (there are too many objects on the map)....
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Wrapper class for managing sound through SEffectManager.
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
static const int LEVER_SPARKS
static PowerGeneratorStatic GetClosestGenerator(vector position, float tolerance)
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.
Manager class for managing Effect (EffectParticle, EffectSound)
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto int GetNumberOfSetBits(int i)
returns the number of bits set in a bitmask i
class JsonUndergroundAreaTriggerData GetPosition
bool Contains(string sample)
Returns true if sample is substring of string.