emotebase.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. class EmoteBase
  2. {
  3. protected PlayerBase m_Player; //useful for various conditions in child classes
  4. protected int m_ID = -1;
  5. protected string m_InputActionName = "";
  6. protected int m_StanceMaskAdditive = 0;
  7. protected int m_StanceMaskFullbody = 0;
  8. protected int m_AdditiveCallbackUID = 0;
  9. protected int m_FullbodyCallbackUID = 0;
  10. protected bool m_HideItemInHands = false;
  11. bool EmoteCondition(int stancemask)
  12. {
  13. return true;
  14. }
  15. bool CanBeCanceledNormally(notnull EmoteCB callback)
  16. {
  17. return true;
  18. }
  19. //! Checks for valid stance mask
  20. bool EmoteFBStanceCheck(int stancemask)
  21. {
  22. int stanceIdx = DayZPlayerUtils.ConvertStanceMaskToStanceIdx(stancemask);
  23. if (!m_Player)
  24. {
  25. ErrorEx("No player for 'PlayerCanChangeStance'");
  26. return false;
  27. }
  28. if (stanceIdx != -1 && !DayZPlayerUtils.PlayerCanChangeStance(m_Player, stanceIdx))
  29. return false;
  30. return true;
  31. }
  32. bool DetermineOverride(out int callback_ID, out int stancemask, out bool is_fullbody)
  33. {
  34. return false;
  35. }
  36. void OnBeforeStandardCallbackCreated(int callback_ID, int stancemask, bool is_fullbody);
  37. void OnCallbackEnd();
  38. bool EmoteStartOverride(typename callbacktype, int id, int mask, bool fullbody)
  39. {
  40. return false;
  41. }
  42. void SetOwnerPlayer(PlayerBase player)
  43. {
  44. m_Player = player;
  45. }
  46. ///////////
  47. //Getters//
  48. ///////////
  49. PlayerBase GetOwnerPlayer()
  50. {
  51. return m_Player;
  52. }
  53. int GetID()
  54. {
  55. return m_ID;
  56. }
  57. string GetInputActionName()
  58. {
  59. return m_InputActionName;
  60. }
  61. int GetStanceMaskAdditive()
  62. {
  63. return m_StanceMaskAdditive;
  64. }
  65. int GetStanceMaskFullbody()
  66. {
  67. return m_StanceMaskFullbody;
  68. }
  69. int GetAdditiveCallbackUID()
  70. {
  71. return m_AdditiveCallbackUID;
  72. }
  73. int GetFullbodyCallbackUID()
  74. {
  75. return m_FullbodyCallbackUID;
  76. }
  77. bool GetHideItemInHands()
  78. {
  79. return m_HideItemInHands;
  80. }
  81. /*
  82. protected int m_StanceMaskAdditive = 0;
  83. protected int m_StanceMaskFullbody = 0;
  84. */
  85. }