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;
75 return "FireworksLauncher_Explosion_SoundSet";
93 int colorSequenceLastIndex =
m_Item.GetColorSequence().Length() - 1;
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();
178 if (m_ShotTrajectory)
180 m_ShotTrajectory.Destroy();
181 m_ShotTrajectory = null;
205 FireworksLauncherClientEventSecondary evnt =
new FireworksLauncherClientEventSecondary(
m_Item,
m_Index);
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");
299 m_ShotDir.Normalize();
337 RegisterNetSyncVariableInt(
"m_Index", 0,
GetMaxShots());
338 RegisterNetSyncVariableInt(
"m_RandomSeed", 0, 1023);
340 RegisterNetSyncVariableInt(
"m_ColorSequenceIndex", 0, lastIndex);
386 ErrorEx(
"Failed to obtain color sequence");
387 return "RYPBYYPBRGBYPBRGBRBGBPBRGRGBRBGRYPYR";
394 super.OnPlacementComplete(player, position, orientation);
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);
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];
557 SetHealth01(
"",
"",0);
610 FireworksLauncherClientEventBase fireEvent =
SpawnEvent();
624 super.OnVariablesSynchronized();
636 super.OnStoreSave(ctx);
644 if (!super.OnStoreLoad(ctx, version))
668 return "placeFireworks_SoundSet";
673 return "fireworks_deploy_SoundSet";
681 if(
g_Game.IsDedicatedServer())
684 debug_output+=
"m_Index:" +
m_Index +
"\n";
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Wrapper class for managing sound through SEffectManager.
void PlayExplosionSound()
void ~FireworksLauncherClientEvent()
int GetSecondaryExplosionDelay()
ParticleSource m_ParticleExplosion
void RequestSecondaryExplosion()
float GetShotDispersionAngle()
int m_RemainingExplosions
float GetExplosionDelay()
vector GetExplosionPosition()
ExplosionLight m_ExplosionLight
int GetExplParticleFromSequence()
void SpawnSecondaryExplosion()
float GetExplosionDistance()
ParticleSource m_ParticleAfterBurnEnd
EffectSound m_ExplosionSound
ref array< ref FireworksLauncherClientEventBase > m_Events
void FireworksLauncherClientEvent(FireworksLauncher item, int index)
string GetExplosionSoundSet()
void SetupLight(PointLightBase light)
int GetSecondaryExplosionCount()
ParticleSource m_ParticleShot
void CalculateExplosionPosition()
void OnFiringStartServer()
override string GetDeploySoundset()
void SetupColorSequences()
EffectSound m_FuseSoundStart
void RestartEventTimer()
Starts event timer.
bool CanIgniteItem(EntityAI ignite_target=NULL)
ParticleSource m_ParticleFuse
override string GetLoopDeploySoundset()
bool CanPutInCargo(EntityAI parent)
string GetColorSequence()
FireworksLauncherClientEventBase SpawnEvent()
void OnStateChangedClient(EFireworksState currentState)
bool CanPutIntoHands(EntityAI parent)
void OnStateChangedServer(EFireworksState currentState)
void OnFuseIgnitedServer()
void OnFuseIgnitedClient()
void OnVariablesSynchronized()
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
float GetMaxAllowedWetness()
void OnFiringStartClient()
ParticleSource m_ParticleAfterBurnEnd
override bool IsDeployable()
bool OnStoreLoad(ParamsReadContext ctx, int version)
ref array< ref FireworksLauncherClientEventBase > m_Events
ref array< string > m_ColorSequence
void ~FireworksLauncher()
void OnEventServer(int type)
Called periodically but only after the entity gets ignited.
void OnStoreSave(ParamsWriteContext ctx)
override float GetDeployTime()
how long it takes to deploy this item in seconds
void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
void OnIndexChangedClient()
static const int FIREWORKS_EXPLOSION_RED
static const int FIREWORKS_AFTERBURN_END
static const int FIREWORKS_EXPLOSION_YELLOW
static const int FIREWORKS_EXPLOSION_GREEN
static const int FIREWORKS_FUSE
static const int FIREWORKS_EXPLOSION_BLUE
static const int FIREWORKS_SHOT
static const int FIREWORKS_EXPLOSION_PINK
Entity which has the particle instance as an ObjectComponent.
Manager class for managing Effect (EffectParticle, EffectSound).
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
DamageType
exposed from C++ (do not change)
Particle m_ParticleExplosion
particle
ExplosionLight PointLightBase OnFired()
FireworksLauncherClientEvent m_ShotPos
Serializer ParamsReadContext
Serializer ParamsWriteContext
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto int Randomize(int seed)
Sets the seed for the random number generator.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
vector GetPosition()
Get the world position of the Effect.
proto native int GetState()
returns one of STATE_...
enum EObjectTemperatureState m_State
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor).
void SetState(bool state)