actioneatfruit.c 743 B

1234567891011121314151617181920212223242526272829303132
  1. class ActionEatFruitCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_NORMAL,UATimeSpent.DEFAULT);
  6. }
  7. };
  8. class ActionEatFruit: ActionEatBig
  9. {
  10. void ActionEatFruit()
  11. {
  12. m_CallbackClass = ActionEatFruitCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EAT;
  14. m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EAT;
  15. }
  16. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  17. {
  18. if (!super.ActionCondition(player, target, item))
  19. return false;
  20. Edible_Base food_item;
  21. if ( Class.CastTo(food_item, item) )
  22. {
  23. if ( food_item.IsFruit() )
  24. return true;
  25. }
  26. return false;
  27. }
  28. }