fireworkslauncher.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. class ExplosionLight : PointLightBase
  2. {
  3. void ExplosionLight()
  4. {
  5. SetVisibleDuringDaylight(true);
  6. SetRadiusTo(60);
  7. SetBrightnessTo(0.05);
  8. SetFlareVisible(false);
  9. SetAmbientColor(1.0, 1.0, 1.0);
  10. SetDiffuseColor(1.0, 1.0, 1.0);
  11. SetLifetime(2.1);
  12. //SetDisableShadowsWithinRadius(-1);
  13. SetFadeOutTime(1);
  14. m_FadeInTime = 0.25;
  15. SetFlickerSpeed(7);
  16. //SetFlickerAmplitude(0.5);
  17. SetFlickerAmplitudeMax(3);
  18. SetFlickerAmplitudeMin(0);
  19. SetCastShadow( false );
  20. }
  21. }
  22. //-----------------------------------------------------------------------------------------------
  23. class FireworksLauncherClientEventBase
  24. {
  25. void OnFired();
  26. }
  27. //-----------------------------------------------------------------------------------------------
  28. class FireworksLauncherClientEvent : FireworksLauncherClientEventBase
  29. {
  30. protected ref Timer m_Timer = new Timer();
  31. protected FireworksLauncher m_Item;
  32. protected int m_Index;
  33. protected vector m_ExplosionPos;
  34. protected EffectSound m_FireSound;
  35. protected EffectSound m_ExplosionSound;
  36. protected ParticleSource m_ParticleShot;
  37. protected ParticleSource m_ParticleExplosion;
  38. protected vector m_ShotDir;
  39. protected ExplosionLight m_ExplosionLight;
  40. protected ParticleSource m_ParticleAfterBurnEnd;
  41. protected string m_Color;
  42. protected int m_RemainingExplosions = GetSecondaryExplosionCount();
  43. protected ref array<ref FireworksLauncherClientEventBase> m_Events = new ref array<ref FireworksLauncherClientEventBase>;
  44. #ifdef DEVELOPER
  45. Shape m_ShotTrajectory;
  46. #endif
  47. // -----------------------------
  48. // ------- Tweaking Start-------
  49. // -----------------------------
  50. protected int GetSoundDelay()
  51. {
  52. return 0;
  53. }
  54. protected int GetLightDelay()
  55. {
  56. return 0;
  57. }
  58. protected float GetExplosionDistance()
  59. {
  60. return Math.RandomFloatInclusive(35,40);
  61. }
  62. protected float GetShotDispersionAngle()
  63. {
  64. return Math.RandomFloatInclusive(-25,25);//this is rotated 360 degrees around the UP vector too
  65. }
  66. protected string GetExplosionSoundSet()
  67. {
  68. return "FireworksLauncher_Explosion_SoundSet";
  69. }
  70. protected float GetExplosionDelay()
  71. {
  72. return Math.RandomFloatInclusive(1.5,1.75);
  73. }
  74. // -----------------------------
  75. // ------- Tweaking End --------
  76. // -----------------------------
  77. void FireworksLauncherClientEvent(FireworksLauncher item, int index)
  78. {
  79. m_Item = item;
  80. m_Index = index;
  81. int colorSequenceLastIndex = m_Item.GetColorSequence().Length() - 1;
  82. int coloreSequenceIndex = m_Index - 1;//shot index(m_Index) starts at 1
  83. if (colorSequenceLastIndex >= coloreSequenceIndex)
  84. {
  85. m_Color = m_Item.GetColorSequence().Get(coloreSequenceIndex);
  86. }
  87. else
  88. {
  89. Debug.LogError("Failed to obtain color from color sequence");
  90. m_Color = "B";
  91. }
  92. }
  93. void ~FireworksLauncherClientEvent()
  94. {
  95. SEffectManager.DestroyEffect(m_FireSound);
  96. SEffectManager.DestroyEffect(m_ExplosionSound);
  97. if (m_ParticleAfterBurnEnd)
  98. {
  99. m_ParticleAfterBurnEnd.StopParticle();
  100. }
  101. }
  102. override protected void OnFired()
  103. {
  104. m_Timer.Run(GetExplosionDelay(), this, "OnExplode", null);
  105. m_Item.PlaySoundSet( m_FireSound, "FireworksLauncher_Shot_SoundSet", 0, 0 );
  106. m_ParticleShot = ParticleManager.GetInstance().PlayInWorld(ParticleList.FIREWORKS_SHOT, GetShotPos());
  107. m_ParticleShot.SetYawPitchRoll(Vector(Math.RandomFloatInclusive(0,360),GetShotDispersionAngle(),0));
  108. m_ParticleAfterBurnEnd = ParticleManager.GetInstance().PlayInWorld(ParticleList.FIREWORKS_AFTERBURN_END, GetShotPos());
  109. if (m_ParticleAfterBurnEnd)
  110. m_ParticleAfterBurnEnd.SetOwner(this);
  111. m_ShotDir = m_ParticleShot.GetDirectionUp();
  112. #ifdef DEVELOPER
  113. vector pts[2];
  114. pts[0] = GetShotPos();
  115. pts[1] = GetShotPos() + m_ShotDir * GetExplosionDistance();
  116. //m_ShotTrajectory = Shape.CreateLines(COLOR_RED, ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE|ShapeFlags.NOZBUFFER, pts, 2);
  117. #endif
  118. }
  119. protected vector GetShotPos()
  120. {
  121. vector memPos;
  122. string memName = "Shot_" + m_Index;
  123. if (m_Item.MemoryPointExists(memName))
  124. {
  125. memPos = m_Item.GetMemoryPointPos(memName);
  126. memPos = m_Item.ModelToWorld(memPos);
  127. }
  128. else
  129. {
  130. memPos = m_Item.GetPosition();//fallback to item's location
  131. Debug.LogError("Missing shot memory point on Fireworks");
  132. }
  133. return memPos;
  134. }
  135. protected void CalculateExplosionPosition()
  136. {
  137. m_ExplosionPos = GetShotPos() + m_ShotDir * GetExplosionDistance();
  138. }
  139. protected vector GetExplosionPosition()
  140. {
  141. if (!m_ExplosionPos)
  142. {
  143. CalculateExplosionPosition();
  144. }
  145. return m_ExplosionPos;
  146. }
  147. int GetSecondaryExplosionCount()
  148. {
  149. return 4;
  150. }
  151. protected void OnExplode()
  152. {
  153. #ifdef DEVELOPER
  154. if (m_ShotTrajectory)
  155. {
  156. m_ShotTrajectory.Destroy();
  157. m_ShotTrajectory = null;
  158. }
  159. #endif
  160. m_ParticleAfterBurnEnd.Stop();
  161. GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( PlayExplosionSound, GetSoundDelay(), false);
  162. GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( SpawnLight, GetLightDelay(), false);
  163. m_ParticleExplosion = ParticleManager.GetInstance().PlayInWorld(GetExplParticleFromSequence(), GetExplosionPosition());
  164. RequestSecondaryExplosion();
  165. }
  166. protected void RequestSecondaryExplosion()
  167. {
  168. if (m_RemainingExplosions> 0)
  169. {
  170. m_RemainingExplosions--;
  171. GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( SpawnSecondaryExplosion, GetSecondaryExplosionDelay(), false);
  172. }
  173. }
  174. protected void SpawnSecondaryExplosion()
  175. {
  176. FireworksLauncherClientEventSecondary evnt = new FireworksLauncherClientEventSecondary(m_Item,m_Index);
  177. evnt.Init(GetExplosionPosition());
  178. evnt.OnExplode();
  179. m_Events.Insert(evnt);
  180. RequestSecondaryExplosion();
  181. }
  182. protected int GetSecondaryExplosionDelay()
  183. {
  184. return Math.RandomIntInclusive(100,250);
  185. }
  186. protected int GetExplParticleFromSequence()
  187. {
  188. switch (m_Color)
  189. {
  190. case "R":
  191. return ParticleList.FIREWORKS_EXPLOSION_RED;
  192. case "G":
  193. return ParticleList.FIREWORKS_EXPLOSION_GREEN;
  194. case "B":
  195. return ParticleList.FIREWORKS_EXPLOSION_BLUE;
  196. case "Y":
  197. return ParticleList.FIREWORKS_EXPLOSION_YELLOW;
  198. case "P":
  199. return ParticleList.FIREWORKS_EXPLOSION_PINK;
  200. default:
  201. ErrorEx("Incorrect explosion particle color in the sequence");
  202. }
  203. return ParticleList.FIREWORKS_EXPLOSION_RED;
  204. }
  205. protected void SetupLight(PointLightBase light)
  206. {
  207. switch (m_Color)
  208. {
  209. case "R":
  210. light.SetDiffuseColor(255,51,51);
  211. light.SetAmbientColor(255,51,51);
  212. break;
  213. case "G":
  214. light.SetDiffuseColor(0,255,128);
  215. light.SetAmbientColor(0,255,128);
  216. break;
  217. case "B":
  218. light.SetDiffuseColor(51,153,255);
  219. light.SetAmbientColor(51,153,255);
  220. break;
  221. case "Y":
  222. light.SetDiffuseColor(255,255,51);
  223. light.SetAmbientColor(255,255,51);
  224. break;
  225. case "P":
  226. light.SetDiffuseColor(255,102,255);
  227. light.SetAmbientColor(255,102,255);
  228. break;
  229. default:
  230. ErrorEx("Incorrect explosion particle color in the sequence");
  231. }
  232. }
  233. protected void SpawnLight()
  234. {
  235. m_ExplosionLight = ExplosionLight.Cast( ScriptedLightBase.CreateLight( ExplosionLight, GetExplosionPosition()) );
  236. SetupLight(m_ExplosionLight);
  237. }
  238. protected void PlayExplosionSound()
  239. {
  240. if (m_FireSound)
  241. {
  242. m_FireSound.Stop();
  243. }
  244. m_Item.PlaySoundSet( m_ExplosionSound, GetExplosionSoundSet(), 0, 0 );
  245. }
  246. }
  247. //------------------------------------------------------------------------------------
  248. class FireworksLauncherClientEventSecondary : FireworksLauncherClientEvent
  249. {
  250. protected vector m_ShotPos;
  251. override protected vector GetExplosionPosition()
  252. {
  253. return GetShotPos() + m_ShotDir * GetExplosionDistance();
  254. }
  255. void Init(vector pos)
  256. {
  257. m_ShotPos = pos;
  258. m_ShotDir[0] = Math.RandomFloatInclusive(-1,1);
  259. m_ShotDir[1] = Math.RandomFloatInclusive(-1,1);
  260. m_ShotDir[2] = Math.RandomFloatInclusive(-1,1);
  261. m_ShotDir.Normalize();
  262. }
  263. override protected vector GetShotPos()
  264. {
  265. return m_ShotPos;
  266. }
  267. override protected float GetExplosionDistance()
  268. {
  269. return Math.RandomFloatInclusive(10,15);
  270. }
  271. override void OnExplode()
  272. {
  273. GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( PlayExplosionSound, GetSoundDelay(), false);
  274. GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( SpawnLight, GetLightDelay(), false);
  275. m_ParticleExplosion = ParticleManager.GetInstance().PlayInWorld(GetExplParticleFromSequence(), GetExplosionPosition());
  276. }
  277. }
  278. class FireworksLauncher: FireworksBase
  279. {
  280. int m_Index;//counts the shots
  281. int m_IndexPrev;//counts the shots
  282. int m_ColorSequenceIndex;
  283. ref Timer m_TimerFuse;
  284. ref array<ref FireworksLauncherClientEventBase> m_Events;
  285. EffectSound m_FuseSoundStart;
  286. EffectSound m_FuseSound;
  287. ParticleSource m_ParticleFuse;
  288. ParticleSource m_ParticleAfterBurnEnd;
  289. ref array<string> m_ColorSequence;
  290. void FireworksLauncher()
  291. {
  292. m_ColorSequence = new array<string>();
  293. SetupColorSequences();
  294. RegisterNetSyncVariableInt("m_State", 0, EnumTools.GetLastEnumValue(EFireworksState));
  295. RegisterNetSyncVariableInt("m_Index", 0, GetMaxShots());
  296. RegisterNetSyncVariableInt("m_RandomSeed", 0, 1023);
  297. int lastIndex = m_ColorSequence.Count() - 1;
  298. RegisterNetSyncVariableInt("m_ColorSequenceIndex", 0, lastIndex);
  299. m_RandomSeed = Math.RandomInt(0,1023);
  300. m_ColorSequenceIndex = Math.RandomIntInclusive(0, lastIndex);
  301. }
  302. void ~FireworksLauncher()
  303. {
  304. SEffectManager.DestroyEffect(m_FuseSound);
  305. SEffectManager.DestroyEffect(m_FuseSoundStart);
  306. }
  307. override bool IsDeployable()
  308. {
  309. return true;
  310. }
  311. //!how long it takes to deploy this item in seconds
  312. override float GetDeployTime()
  313. {
  314. return 2;
  315. }
  316. protected void SetupColorSequences()
  317. {
  318. m_ColorSequence.Insert("RGBYPBRGBRGBYPBRGBRGBYPBRGBPBRGBRGBY");
  319. m_ColorSequence.Insert("PGPYPBYPYPBYYPBRPYPBYYPBRGBPBRGRGBRB");
  320. m_ColorSequence.Insert("YPBRPYPBYYPBRGBPBRGRGBRBGRPBRGBRYPBY");
  321. m_ColorSequence.Insert("YRBGPRYPGRYBGRGRGBRBBYPYPBYRYPGRYGRP");
  322. m_ColorSequence.Insert("BGRYPYRPBYYPYRBGPRYPGBYPBRGBPBRGBRGB");
  323. m_ColorSequence.Insert("RYGRPBRGBYPBRRPBRGBBRBBYPYPRGBRGBRPY");
  324. m_ColorSequence.Insert("GBRGBYRGBYPBRRPBRBYRYPGPYPRGBRGBRPYG");
  325. m_ColorSequence.Insert("RYPBYYPBRGBYPBRGBRBGBPBRGRGBRBGRYPYR");
  326. m_ColorSequence.Insert("PBRGBYPBRGBRBGBPBRGRGBRBGRYPYRRYPBYY");
  327. m_ColorSequence.Insert("RGRGBRBBYPYPBYRYPGRYGRPYRBGPRYPGRYBG");
  328. m_ColorSequence.Insert("RBYRYPGPYPRGBRGBRPYGGBRGBYRGBYPBRRPB");
  329. m_ColorSequence.Insert("PRGBRGBRPYGGBRRBYRYPGPYGBYRGBYPBRRPB");
  330. }
  331. string GetColorSequence()
  332. {
  333. if (m_ColorSequence.IsValidIndex(m_ColorSequenceIndex))
  334. {
  335. return m_ColorSequence.Get(m_ColorSequenceIndex);
  336. }
  337. else
  338. {
  339. ErrorEx("Failed to obtain color sequence");
  340. return "RYPBYYPBRGBYPBRGBRBGBPBRGRGBRBGRYPYR";
  341. }
  342. }
  343. override protected void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
  344. {
  345. super.OnPlacementComplete(player, position, orientation);
  346. if (GetGame().IsServer())
  347. {
  348. if (GetState() == EFireworksState.DEFAULT)
  349. {
  350. SetState(EFireworksState.PLACED);
  351. }
  352. }
  353. }
  354. override protected float GetMaxAllowedWetness()
  355. {
  356. return GameConstants.STATE_WET;
  357. }
  358. override protected float GetEventDelay()
  359. {
  360. return Math.RandomFloatInclusive(3,3.35);
  361. }
  362. protected string GetFuseSoundSet()
  363. {
  364. return "FireworksLauncher_Ignition_Loop_SoundSet";
  365. }
  366. protected int GetMaxShots()
  367. {
  368. return 16;
  369. }
  370. protected float GetFuseDelay()
  371. {
  372. return 3;
  373. }
  374. protected string GetAmmoType()
  375. {
  376. return "Fireworks_Ammo";
  377. }
  378. protected int GetDamageType()
  379. {
  380. return DamageType.EXPLOSION;
  381. }
  382. override protected void OnStateChangedServer(EFireworksState currentState)
  383. {
  384. switch (currentState)
  385. {
  386. case EFireworksState.PLACED:
  387. break
  388. case EFireworksState.IGNITED:
  389. OnFuseIgnitedServer();
  390. break
  391. case EFireworksState.FIRING:
  392. HideSelection("cover");
  393. OnFiringStartServer();
  394. break
  395. case EFireworksState.FINISHED:
  396. HideSelection("cover");//when loading from storage
  397. break
  398. default: {};
  399. }
  400. }
  401. override protected void OnStateChangedClient(EFireworksState currentState)
  402. {
  403. switch (currentState)
  404. {
  405. case EFireworksState.IGNITED:
  406. OnFuseIgnitedClient();
  407. break
  408. case EFireworksState.PLACED:
  409. break
  410. case EFireworksState.FIRING:
  411. OnFiringStartClient();
  412. break
  413. default: {};
  414. }
  415. }
  416. //! Executed on Server when some item ignited this one
  417. override void OnIgnitedThis( EntityAI fire_source)
  418. {
  419. super.OnIgnitedThis(fire_source);
  420. if (m_Events)
  421. {
  422. m_Events.Clear();
  423. }
  424. m_Index = 0;
  425. if (m_TimerEvent)
  426. {
  427. m_TimerEvent.Stop();
  428. }
  429. }
  430. override protected bool CanPutInCargo( EntityAI parent )
  431. {
  432. return (GetState() == EFireworksState.DEFAULT || (GetState() == EFireworksState.PLACED) || (GetState() == EFireworksState.FINISHED);
  433. }
  434. override protected bool CanPutIntoHands( EntityAI parent )
  435. {
  436. return (GetState() == EFireworksState.DEFAULT || (GetState() == EFireworksState.PLACED) || (GetState() == EFireworksState.FINISHED);
  437. }
  438. protected void OnFuseIgnitedServer()
  439. {
  440. int state = EFireworksState.FIRING;
  441. GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( SetState, GetFuseDelay()*1000, false, state);
  442. }
  443. protected void OnFuseIgnitedClient()
  444. {
  445. m_ParticleFuse = ParticleManager.GetInstance().PlayInWorld(ParticleList.FIREWORKS_FUSE, GetPosition() + "0 0.15 0");
  446. if (m_ParticleFuse)
  447. m_ParticleFuse.SetOwner(this);
  448. PlaySoundSet( m_FuseSoundStart, "FireworksLauncher_Ignition_Start_SoundSet", 0, 0 );
  449. vector fuseStart;
  450. vector fuseEnd;
  451. if (MemoryPointExists("Fuse_Start"))
  452. {
  453. fuseStart = GetMemoryPointPos("Fuse_Start");
  454. fuseStart = ModelToWorld(fuseStart);
  455. }
  456. if (MemoryPointExists("Fuse_End"))
  457. {
  458. fuseEnd = GetMemoryPointPos("Fuse_End");
  459. fuseEnd = ModelToWorld(fuseEnd);
  460. }
  461. vector fuseDir = fuseEnd - fuseStart;
  462. vector fuseOrientation[4];
  463. vector ori = fuseDir.VectorToAngles();
  464. m_ParticleFuse.SetOrientation(ori);
  465. m_ParticleFuse.SetPosition(fuseStart);
  466. PlaySoundSetLoop( m_FuseSound, GetFuseSoundSet(), 0, 0 );
  467. }
  468. protected void OnFiringStartServer()
  469. {
  470. OnEventServer(0);
  471. }
  472. protected void OnFiringStartClient()
  473. {
  474. if (m_ParticleFuse)
  475. {
  476. m_ParticleFuse.StopParticle(StopParticleFlags.IMMEDIATE);
  477. }
  478. if (m_FuseSound)
  479. {
  480. m_FuseSound.Stop();
  481. }
  482. }
  483. protected void OnFiringStop()
  484. {
  485. SetHealth01("","",0);
  486. }
  487. //!Starts event timer
  488. protected void RestartEventTimer()
  489. {
  490. if (!m_TimerEvent)
  491. {
  492. m_TimerEvent = new Timer();
  493. }
  494. m_TimerEvent.Run(GetEventDelay(), this, "OnEventServer", new Param1<int>(0));
  495. }
  496. override protected bool IsIgnited()
  497. {
  498. return GetState()==EFireworksState.IGNITED;
  499. }
  500. override protected bool CanIgniteItem(EntityAI ignite_target = NULL)
  501. {
  502. return false;
  503. }
  504. //!Called periodically but only after the entity gets ignited
  505. override protected void OnEventServer(int type)
  506. {
  507. m_Index++;
  508. DamageSystem.ExplosionDamage(this, NULL, GetAmmoType(), GetPosition(), GetDamageType());
  509. SetSynchDirty();
  510. if (m_Index > GetMaxShots())
  511. {
  512. m_Index = GetMaxShots();
  513. m_TimerEvent = null;
  514. SetState(EFireworksState.FINISHED);
  515. }
  516. else
  517. {
  518. RestartEventTimer();
  519. }
  520. }
  521. protected void OnIndexChangedClient()
  522. {
  523. if (!m_Events)
  524. {
  525. m_Events = new array<ref FireworksLauncherClientEventBase>;
  526. }
  527. if (m_Index != 0 && m_State == EFireworksState.FIRING)//can only be true when restarting the device during debug calls
  528. {
  529. FireworksLauncherClientEventBase fireEvent = SpawnEvent();
  530. m_Events.Insert(fireEvent);
  531. }
  532. }
  533. protected FireworksLauncherClientEventBase SpawnEvent()
  534. {
  535. FireworksLauncherClientEventBase evnt = new FireworksLauncherClientEvent(this,m_Index);
  536. evnt.OnFired();
  537. return evnt;
  538. }
  539. override protected void OnVariablesSynchronized()
  540. {
  541. super.OnVariablesSynchronized();
  542. //Print("index: " + m_Index);
  543. if (m_Index != m_IndexPrev)
  544. {
  545. Math.Randomize(m_RandomSeed+m_Index);
  546. OnIndexChangedClient();
  547. m_IndexPrev = m_Index;
  548. }
  549. }
  550. override protected void OnStoreSave(ParamsWriteContext ctx)
  551. {
  552. super.OnStoreSave(ctx);
  553. ctx.Write(m_Index);
  554. ctx.Write(m_State);
  555. }
  556. override protected bool OnStoreLoad( ParamsReadContext ctx, int version )
  557. {
  558. if (!super.OnStoreLoad(ctx, version))
  559. {
  560. return false;
  561. }
  562. if (version >= 130)
  563. {
  564. if (!ctx.Read(m_Index))
  565. {
  566. return false;
  567. }
  568. if (!ctx.Read(m_State))
  569. {
  570. return false;
  571. }
  572. SetState(m_State);
  573. }
  574. return true;
  575. }
  576. override string GetDeploySoundset()
  577. {
  578. return "placeFireworks_SoundSet";
  579. }
  580. override string GetLoopDeploySoundset()
  581. {
  582. return "fireworks_deploy_SoundSet";
  583. }
  584. #ifdef DEVELOPER
  585. override protected string GetDebugText()
  586. {
  587. string debug_output;
  588. if( GetGame().IsDedicatedServer())
  589. {
  590. debug_output+= EnumTools.EnumToString(EFireworksState, m_State) +"\n";
  591. debug_output+= "m_Index:" + m_Index +"\n";
  592. }
  593. else
  594. {
  595. }
  596. return debug_output;
  597. }
  598. #endif
  599. }