actioneatcan.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. class ActionEatCanCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_BIG, UATimeSpent.DEFAULT);
  6. }
  7. };
  8. class ActionEatCan: ActionEatBig
  9. {
  10. void ActionEatCan()
  11. {
  12. m_CallbackClass = ActionEatCanCB;
  13. }
  14. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  15. {
  16. return super.ActionCondition(player, target, item);
  17. /*
  18. //if staging for cans is introduced
  19. if ( item && item.IsOpen() )
  20. {
  21. return true;
  22. }
  23. return false;
  24. */
  25. }
  26. };
  27. //-----------------SMALL BITES VARIANT-------------------
  28. class ActionEatSmallCanCB : ActionContinuousBaseCB
  29. {
  30. override void CreateActionComponent()
  31. {
  32. m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_SMALL, UATimeSpent.DEFAULT);
  33. }
  34. };
  35. class ActionEatSmallCan: ActionEatBig
  36. {
  37. void ActionEatSmallCan()
  38. {
  39. m_CallbackClass = ActionEatSmallCanCB;
  40. }
  41. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  42. {
  43. if (!super.ActionCondition(player, target, item))
  44. return false;
  45. return true;
  46. /*
  47. //if staging for cans is introduced
  48. if ( item && item.IsOpen() )
  49. {
  50. return true;
  51. }
  52. return false;
  53. */
  54. }
  55. };