actionnextcombinationlockdial.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. class ActionNextCombinationLockDial: ActionSingleUseBase
  2. {
  3. void ActionNextCombinationLockDial()
  4. {
  5. m_Text = "#next_combination_lock_dial";
  6. }
  7. override void CreateConditionComponents()
  8. {
  9. m_ConditionItem = new CCINonRuined;
  10. m_ConditionTarget = new CCTNone;
  11. }
  12. override bool HasTarget()
  13. {
  14. return false;
  15. }
  16. override bool IsInstant()
  17. {
  18. return true;
  19. }
  20. override bool RemoveForceTargetAfterUse()
  21. {
  22. return false;
  23. }
  24. override bool UseAcknowledgment()
  25. {
  26. return true;
  27. }
  28. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  29. {
  30. if ( item.IsInherited( CombinationLock ) )
  31. {
  32. ConstructionActionData construction_action_data = player.GetConstructionActionData();
  33. construction_action_data.SetCombinationLock( CombinationLock.Cast( item ) );
  34. return true;
  35. }
  36. return false;
  37. }
  38. override void Start( ActionData action_data )
  39. {
  40. super.Start( action_data );
  41. //set next dial
  42. CombinationLock combination_lock = CombinationLock.Cast( action_data.m_MainItem );
  43. if ( combination_lock )
  44. {
  45. combination_lock.SetNextDial();
  46. }
  47. }
  48. }