actionpickberry.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. class ActionPickBerryCB : ActionInteractLoopBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAInteractLoop(UATimeSpent.DEFAULT_PICK);
  6. }
  7. /*override void OnAnimationEvent(int pEventID)
  8. {
  9. Print("ActionInteractLoopBase.c | OnAnimationEvent | OnAnimationEvent called");
  10. if ( !m_Interrupted && pEventID == UA_ANIM_EVENT )
  11. {
  12. SetCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
  13. m_State = UA_FINISHED;
  14. m_ActionData.Do(this,m_State,m_ActionComponent,m_Player,m_Target,m_Item);
  15. }
  16. }*/
  17. };
  18. //!DEPRECATED
  19. class ActionPickBerry: ActionInteractLoopBase
  20. {
  21. void ActionPickBerry()
  22. {
  23. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
  24. m_FullBody = true;
  25. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
  26. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_MEDIUM;
  27. m_CallbackClass = ActionPickBerryCB;
  28. m_Text = "#harvest";
  29. }
  30. override void CreateConditionComponents()
  31. {
  32. m_ConditionTarget = new CCTCursor(UAMaxDistances.DEFAULT);
  33. m_ConditionItem = new CCINone;
  34. }
  35. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  36. {
  37. Object targetObject = target.GetObject();
  38. if ( player && targetObject && targetObject.IsWoodBase() )
  39. {
  40. return true;
  41. }
  42. return false;
  43. }
  44. //deprecated
  45. ////override void OnCompleteServer( ActionData action_data )
  46. //{
  47. /*Object targetObject = action_data.m_Target.GetObject();
  48. WoodBase ntarget = WoodBase.Cast( targetObject );
  49. string drop_name = ntarget.GetMaterial(NULL);
  50. float drop_quantity = ntarget.GetAmountOfMaterialPerDrop(action_data.m_MainItem);
  51. targetObject.DecreaseHealth( "", "", (1 / Math.Max(1,ntarget.GetAmountOfDrops(action_data.m_MainItem)))*100, true );
  52. ItemBase drop = ItemBase.Cast( GetGame().CreateObject(drop_name, action_data.m_Player.GetPosition(), false) );
  53. drop.SetQuantity(drop_quantity, false);
  54. action_data.m_Player.GetSoftSkillManager().AddSpecialty( m_SpecialtyWeight );*/
  55. //}
  56. };