actioneat.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. class ActionEatBigCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_BIG, UATimeSpent.DEFAULT);
  6. }
  7. };
  8. class ActionEatBig: ActionConsume
  9. {
  10. void ActionEatBig()
  11. {
  12. m_CallbackClass = ActionEatBigCB;
  13. //m_Sound = "EatingSoft_0";
  14. m_Text = "#eat";
  15. }
  16. override void CreateConditionComponents()
  17. {
  18. m_ConditionItem = new CCINonRuined;
  19. m_ConditionTarget = new CCTSelf;
  20. }
  21. override int IsEat()
  22. {
  23. return true;
  24. }
  25. override bool HasTarget()
  26. {
  27. return false;
  28. }
  29. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  30. {
  31. if (!super.ActionCondition(player, target, item))
  32. return false;
  33. return player.CanEatAndDrink();
  34. }
  35. override void OnEndServer( ActionData action_data )
  36. {
  37. super.OnEndServer(action_data);
  38. if ( action_data.m_Player.HasBloodyHandsEx() == eBloodyHandsTypes.SALMONELA && !action_data.m_Player.GetInventory().FindAttachment( InventorySlots.GLOVES ) && GetProgress(action_data) > 0 )
  39. {
  40. action_data.m_Player.SetBloodyHandsPenalty();
  41. }
  42. }
  43. };
  44. //-------------- Action Eat
  45. class ActionEatCB : ActionEatBigCB
  46. {
  47. override void CreateActionComponent()
  48. {
  49. m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_NORMAL, UATimeSpent.DEFAULT);
  50. }
  51. };
  52. class ActionEat: ActionEatBig
  53. {
  54. void ActionEat()
  55. {
  56. m_CallbackClass = ActionEatCB;
  57. }
  58. };
  59. //-------------- Action Eat Small
  60. class ActionEatSmallCB : ActionEatBigCB
  61. {
  62. override void CreateActionComponent()
  63. {
  64. m_ActionData.m_ActionComponent = new CAContinuousQuantityEdible(UAQuantityConsumed.EAT_SMALL, UATimeSpent.DEFAULT);
  65. }
  66. };
  67. class ActionEatSmall: ActionEatBig
  68. {
  69. void ActionEatSmall()
  70. {
  71. m_CallbackClass = ActionEatSmallCB;
  72. }
  73. };