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(
GetGame().IsDedicatedServer())
684 debug_output+=
"m_Index:" +
m_Index +
"\n";
DamageType
exposed from C++ (do not change)
Particle m_ParticleExplosion
particle
ExplosionLight PointLightBase OnFired()
FireworksLauncherClientEvent m_ShotPos
enum EObjectTemperatureState m_State
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void SetState(bool state)
override ScriptCallQueue GetCallQueue(int call_category)
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.
float GetMaxAllowedWetness()
void RestartEventTimer()
Starts event timer.
void OnStateChangedServer(EFireworksState currentState)
override string GetLoopDeploySoundset()
void OnIndexChangedClient()
ref array< ref FireworksLauncherClientEventBase > m_Events
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()
override float GetDeployTime()
how long it takes to deploy this item in seconds
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnVariablesSynchronized()
bool CanPutInCargo(EntityAI parent)
void OnFiringStartClient()
EffectSound m_FuseSoundStart
void SetupColorSequences()
bool CanPutIntoHands(EntityAI parent)
void ~FireworksLauncher()
ParticleSource m_ParticleFuse
void OnFuseIgnitedClient()
ParticleSource m_ParticleAfterBurnEnd
override bool IsDeployable()
void OnFiringStartServer()
ref array< string > m_ColorSequence
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
void OnStateChangedClient(EFireworksState currentState)
void OnFuseIgnitedServer()
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
static const int FIREWORKS_AFTERBURN_END
static const int FIREWORKS_EXPLOSION_YELLOW
static const int FIREWORKS_EXPLOSION_BLUE
static const int FIREWORKS_EXPLOSION_RED
static const int FIREWORKS_FUSE
static const int FIREWORKS_EXPLOSION_GREEN
static const int FIREWORKS_SHOT
static const int FIREWORKS_EXPLOSION_PINK
Entity which has the particle instance as an ObjectComponent.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Manager class for managing Effect (EffectParticle, EffectSound)
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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.
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
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 proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
class JsonUndergroundAreaTriggerData GetPosition
proto native int GetState()
returns one of STATE_...