torch_video.c 719 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. class Torch_Video : LongTorch
  2. {
  3. protected float PARTICLE_DELAY = 15000;
  4. protected bool m_EnablePtc;
  5. void SetEnablePtc()
  6. {
  7. m_EnablePtc = true;
  8. }
  9. override void OnWork( float consumed_energy )
  10. {
  11. if (!m_EnablePtc)
  12. return;
  13. super.OnWork(consumed_energy);
  14. }
  15. override void OnWorkStart()
  16. {
  17. GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(SetEnablePtc, PARTICLE_DELAY);
  18. super.OnWorkStart();
  19. }
  20. override void OnWorkStop()
  21. {
  22. GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(SetEnablePtc);
  23. m_EnablePtc = false;
  24. super.OnWorkStop();
  25. }
  26. override void SetActions()
  27. {
  28. super.SetActions();
  29. AddAction(ActionLightTorchVideo);
  30. AddAction(ActionExtinquishTorchVideo);
  31. }
  32. }