5 SetVisibleDuringDaylight(
true);
8 SetFlareVisible(
false);
9 SetAmbientColor(1.0, 1.0, 1.0);
10 SetDiffuseColor(1.0, 1.0, 1.0);
17 SetFlickerAmplitudeMax(3);
18 SetFlickerAmplitudeMin(0);
19 SetCastShadow(
false );
23class FireworksLauncherClientEventBase
45 Shape m_ShotTrajectory;
65 return Math.RandomFloatInclusive(35,40);
70 return Math.RandomFloatInclusive(-25,25);
75 return "FireworksLauncher_Explosion_SoundSet";
80 return Math.RandomFloatInclusive(1.5,1.75);
94 int coloreSequenceIndex =
m_Index - 1;
96 if (colorSequenceLastIndex >= coloreSequenceIndex)
102 Debug.LogError(
"Failed to obtain color from color sequence");
140 string memName =
"Shot_" +
m_Index;
142 if (
m_Item.MemoryPointExists(memName))
144 memPos =
m_Item.GetMemoryPointPos(memName);
145 memPos =
m_Item.ModelToWorld(memPos);
149 memPos =
m_Item.GetPosition();
150 Debug.LogError(
"Missing shot memory point on Fireworks");
178 if (m_ShotTrajectory)
180 m_ShotTrajectory.Destroy();
181 m_ShotTrajectory = null;
205 FireworksLauncherClientEventSecondary evnt =
new FireworksLauncherClientEventSecondary(
m_Item,
m_Index);
214 return Math.RandomIntInclusive(100,250);
232 ErrorEx(
"Incorrect explosion particle color in the sequence");
242 light.SetDiffuseColor(255,51,51);
243 light.SetAmbientColor(255,51,51);
247 light.SetDiffuseColor(0,255,128);
248 light.SetAmbientColor(0,255,128);
251 light.SetDiffuseColor(51,153,255);
252 light.SetAmbientColor(51,153,255);
255 light.SetDiffuseColor(255,255,51);
256 light.SetAmbientColor(255,255,51);
259 light.SetDiffuseColor(255,102,255);
260 light.SetAmbientColor(255,102,255);
263 ErrorEx(
"Incorrect explosion particle color in the sequence");
296 m_ShotDir[0] =
Math.RandomFloatInclusive(-1,1);
297 m_ShotDir[1] =
Math.RandomFloatInclusive(-1,1);
298 m_ShotDir[2] =
Math.RandomFloatInclusive(-1,1);
299 m_ShotDir.Normalize();
308 return Math.RandomFloatInclusive(10,15);
323 int m_ColorSequenceIndex;
324 ref
Timer m_TimerFuse;
337 RegisterNetSyncVariableInt(
"m_Index", 0,
GetMaxShots());
338 RegisterNetSyncVariableInt(
"m_RandomSeed", 0, 1023);
339 int lastIndex = m_ColorSequence.Count() - 1;
340 RegisterNetSyncVariableInt(
"m_ColorSequenceIndex", 0, lastIndex);
342 m_ColorSequenceIndex =
Math.RandomIntInclusive(0, lastIndex);
351 override bool IsDeployable()
357 override float GetDeployTime()
364 m_ColorSequence.Insert(
"RGBYPBRGBRGBYPBRGBRGBYPBRGBPBRGBRGBY");
365 m_ColorSequence.Insert(
"PGPYPBYPYPBYYPBRPYPBYYPBRGBPBRGRGBRB");
366 m_ColorSequence.Insert(
"YPBRPYPBYYPBRGBPBRGRGBRBGRPBRGBRYPBY");
367 m_ColorSequence.Insert(
"YRBGPRYPGRYBGRGRGBRBBYPYPBYRYPGRYGRP");
368 m_ColorSequence.Insert(
"BGRYPYRPBYYPYRBGPRYPGBYPBRGBPBRGBRGB");
369 m_ColorSequence.Insert(
"RYGRPBRGBYPBRRPBRGBBRBBYPYPRGBRGBRPY");
370 m_ColorSequence.Insert(
"GBRGBYRGBYPBRRPBRBYRYPGPYPRGBRGBRPYG");
371 m_ColorSequence.Insert(
"RYPBYYPBRGBYPBRGBRBGBPBRGRGBRBGRYPYR");
372 m_ColorSequence.Insert(
"PBRGBYPBRGBRBGBPBRGRGBRBGRYPYRRYPBYY");
373 m_ColorSequence.Insert(
"RGRGBRBBYPYPBYRYPGRYGRPYRBGPRYPGRYBG");
374 m_ColorSequence.Insert(
"RBYRYPGPYPRGBRGBRPYGGBRGBYRGBYPBRRPB");
375 m_ColorSequence.Insert(
"PRGBRGBRPYGGBRRBYRYPGPYGBYRGBYPBRRPB");
380 if (m_ColorSequence.IsValidIndex(m_ColorSequenceIndex))
382 return m_ColorSequence.Get(m_ColorSequenceIndex);
386 ErrorEx(
"Failed to obtain color sequence");
387 return "RYPBYYPBRGBYPBRGBRBGBPBRGRGBRBGRYPYR";
394 super.OnPlacementComplete(player, position, orientation);
412 return Math.RandomFloatInclusive(3,3.35);
417 return "FireworksLauncher_Ignition_Loop_SoundSet";
432 return "Fireworks_Ammo";
443 switch (currentState)
451 HideSelection(
"cover");
455 HideSelection(
"cover");
463 switch (currentState)
480 super.OnIgnitedThis(fire_source);
513 m_ParticleFuse.SetOwner(
this);
514 PlaySoundSet( m_FuseSoundStart,
"FireworksLauncher_Ignition_Start_SoundSet", 0, 0 );
518 if (MemoryPointExists(
"Fuse_Start"))
520 fuseStart = GetMemoryPointPos(
"Fuse_Start");
521 fuseStart = ModelToWorld(fuseStart);
523 if (MemoryPointExists(
"Fuse_End"))
525 fuseEnd = GetMemoryPointPos(
"Fuse_End");
526 fuseEnd = ModelToWorld(fuseEnd);
529 vector fuseDir = fuseEnd - fuseStart;
530 vector fuseOrientation[4];
531 vector ori = fuseDir.VectorToAngles();
532 m_ParticleFuse.SetOrientation(ori);
533 m_ParticleFuse.SetPosition(fuseStart);
547 m_ParticleFuse.StopParticle(StopParticleFlags.IMMEDIATE);
557 SetHealth01(
"",
"",0);
610 FireworksLauncherClientEventBase fireEvent =
SpawnEvent();
611 m_Events.Insert(fireEvent);
624 super.OnVariablesSynchronized();
626 if (m_Index != m_IndexPrev)
630 m_IndexPrev = m_Index;
636 super.OnStoreSave(ctx);
644 if (!super.OnStoreLoad(ctx, version))
651 if (!ctx.Read(m_Index))
668 return "placeFireworks_SoundSet";
673 return "fireworks_deploy_SoundSet";
681 if(
GetGame().IsDedicatedServer())
684 debug_output+=
"m_Index:" + m_Index +
"\n";
Wrapper class for managing sound through SEffectManager.
override void Stop()
Stops sound.
int GetSecondaryExplosionDelay()
void FireworksLauncherClientEvent(FireworksLauncher item, int index)
int m_RemainingExplosions
void ~FireworksLauncherClientEvent()
ParticleSource m_ParticleAfterBurnEnd
ExplosionLight m_ExplosionLight
ref array< ref FireworksLauncherClientEventBase > m_Events
ParticleSource m_ParticleExplosion
float GetExplosionDistance()
void SpawnSecondaryExplosion()
int GetSecondaryExplosionCount()
int GetExplParticleFromSequence()
void SetupLight(PointLightBase light)
string GetExplosionSoundSet()
void PlayExplosionSound()
void CalculateExplosionPosition()
void RequestSecondaryExplosion()
float GetExplosionDelay()
vector GetExplosionPosition()
EffectSound m_ExplosionSound
float GetShotDispersionAngle()
ParticleSource m_ParticleShot
float GetMaxAllowedWetness()
void RestartEventTimer()
Starts event timer.
void OnStateChangedServer(EFireworksState currentState)
override string GetLoopDeploySoundset()
void OnIndexChangedClient()
override string GetDeploySoundset()
void OnEventServer(int type)
Called periodically but only after the entity gets ignited.
FireworksLauncherClientEventBase SpawnEvent()
bool CanIgniteItem(EntityAI ignite_target=NULL)
void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
string GetColorSequence()
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnVariablesSynchronized()
bool CanPutInCargo(EntityAI parent)
void OnFiringStartClient()
void SetupColorSequences()
bool CanPutIntoHands(EntityAI parent)
void OnFuseIgnitedClient()
void OnFiringStartServer()
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
void OnStateChangedClient(EFireworksState currentState)
void OnFuseIgnitedServer()
static Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
Entity which has the particle instance as an ObjectComponent.
static override Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Serialization general interface. Serializer API works with:
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DamageType
exposed from C++ (do not change)
Particle m_ParticleExplosion
particle
ExplosionLight PointLightBase OnFired()
FireworksLauncherClientEvent m_ShotPos
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
class JsonUndergroundAreaTriggerData GetPosition
enum EObjectTemperatureState m_State
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void SetState(bool state)