actionlighttorchvideo.c 703 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. class ActionLightTorchVideo : ActionBase
  2. {
  3. void ActionLightTorchVideo()
  4. {
  5. m_Text = "#switch_on";
  6. }
  7. override void CreateConditionComponents()
  8. {
  9. m_ConditionItem = new CCINonRuined();
  10. m_ConditionTarget = new CCTNone();
  11. }
  12. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  13. {
  14. if (item.GetCompEM() && !item.GetCompEM().IsSwitchedOn())
  15. return true;
  16. return false;
  17. }
  18. override bool IsInstant()
  19. {
  20. return true;
  21. }
  22. override bool HasTarget()
  23. {
  24. return false;
  25. }
  26. override void OnStartServer( ActionData action_data )
  27. {
  28. ClearActionJuncture(action_data);
  29. ItemBase item = action_data.m_MainItem;
  30. item.GetCompEM().SwitchOn();
  31. }
  32. }