actionhandspartswitch.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //!DEPRECATED
  2. class ActionHandsPartSwitch: ActionSingleUseBase
  3. {
  4. void ActionHandsPartSwitch()
  5. {
  6. }
  7. override void CreateConditionComponents()
  8. {
  9. m_ConditionItem = new CCINone; //'CCINotPresent' to perfom with empty hands only
  10. m_ConditionTarget = new CCTCursor;
  11. m_Text = "#switch_to_the_next_part";
  12. }
  13. override bool IsInstant()
  14. {
  15. return true;
  16. }
  17. override typename GetInputType()
  18. {
  19. return InteractActionInput;
  20. }
  21. override bool RemoveForceTargetAfterUse()
  22. {
  23. return false;
  24. }
  25. override bool UseAcknowledgment()
  26. {
  27. return true;
  28. }
  29. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  30. {
  31. return false;
  32. }
  33. //-------------------------------------------------
  34. override void OnStartClient(ActionData action_data)
  35. {
  36. super.OnStartClient( action_data );
  37. SetNextIndex(action_data);
  38. }
  39. override void OnStartServer(ActionData action_data)
  40. {
  41. super.OnStartServer( action_data );
  42. if (!GetGame().IsMultiplayer())
  43. SetNextIndex(action_data);
  44. }
  45. void SetNextIndex(ActionData action_data)
  46. {
  47. ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
  48. construction_action_data.SetNextIndex();
  49. }
  50. }