actionworldcraftswitch.c 816 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //!DEPRECATED
  2. class ActionWorldCraftSwitch: ActionSingleUseBase
  3. {
  4. void ActionWorldCraftSwitch()
  5. {
  6. m_Text = "#next_recipe";
  7. }
  8. override void CreateConditionComponents()
  9. {
  10. m_ConditionItem = new CCINone;
  11. m_ConditionTarget = new CCTObject(UAMaxDistances.DEFAULT);
  12. }
  13. override bool IsLocal()
  14. {
  15. return true;
  16. }
  17. override bool IsInstant()
  18. {
  19. return true;
  20. }
  21. override bool RemoveForceTargetAfterUse()
  22. {
  23. return false;
  24. }
  25. override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item )
  26. {
  27. if ( player.GetCraftingManager().GetRecipesCount() > 1 )
  28. {
  29. return true;
  30. }
  31. return false;
  32. }
  33. override void Start( ActionData action_data ) //Setup on start of action
  34. {
  35. super.Start( action_data );
  36. action_data.m_Player.GetCraftingManager().SetNextRecipe();
  37. }
  38. };