freezestate.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. class FreezeSymptom extends SymptomBase
  2. {
  3. //this is just for the Symptom parameters set-up and is called even if the Symptom doesn't execute, don't put any gameplay code in here
  4. override void OnInit()
  5. {
  6. m_SymptomType = SymptomTypes.PRIMARY;
  7. m_Priority = 1;
  8. m_ID = SymptomIDs.SYMPTOM_FREEZE;
  9. m_DestroyOnAnimFinish = true;
  10. m_SyncToClient = false;
  11. m_MaxCount = 2;
  12. }
  13. //!gets called every frame
  14. override void OnUpdateServer(PlayerBase player, float deltatime)
  15. {
  16. }
  17. override void OnUpdateClient(PlayerBase player, float deltatime)
  18. {
  19. }
  20. override void OnAnimationPlayFailed()
  21. {
  22. }
  23. override bool CanActivate()
  24. {
  25. return true;
  26. }
  27. //!gets called once on an Symptom which is being activated
  28. override void OnGetActivatedServer(PlayerBase player)
  29. {
  30. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  31. HumanMovementState hms = new HumanMovementState();
  32. player.GetMovementState(hms);
  33. ItemBase item = m_Player.GetItemInHands();
  34. if (!(item && item.IsHeavyBehaviour()) && !m_Player.IsSurrendered() && m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE && hms.m_iMovement == DayZPlayerConstants.MOVEMENTIDX_IDLE && !player.IsRestrained() && !player.IsInProne())
  35. {
  36. PlayAnimationADD(2);
  37. }
  38. else
  39. {
  40. PlaySound(EPlayerSoundEventID.FREEZING);
  41. }
  42. }
  43. //!gets called once on a Symptom which is being activated
  44. override void OnGetActivatedClient(PlayerBase player)
  45. {
  46. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  47. }
  48. //!only gets called once on an active Symptom that is being deactivated
  49. override void OnGetDeactivatedServer(PlayerBase player)
  50. {
  51. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  52. }
  53. //!only gets called once on an active Symptom that is being deactivated
  54. override void OnGetDeactivatedClient(PlayerBase player)
  55. {
  56. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  57. }
  58. override SmptAnimMetaBase SpawnAnimMetaObject()
  59. {
  60. return new HeatComfortmMetaADD();
  61. }
  62. }
  63. class FreezeRattleSymptom extends SymptomBase
  64. {
  65. //this is just for the Symptom parameters set-up and is called even if the Symptom doesn't execute, don't put any gameplay code in here
  66. override void OnInit()
  67. {
  68. m_SymptomType = SymptomTypes.PRIMARY;
  69. m_Priority = 100;
  70. m_ID = SymptomIDs.SYMPTOM_FREEZE_RATTLE;
  71. m_DestroyOnAnimFinish = true;
  72. m_SyncToClient = false;
  73. m_MaxCount = 2;
  74. m_Duration = 2;
  75. }
  76. override bool CanActivate()
  77. {
  78. return true;
  79. }
  80. //!gets called once on an Symptom which is being activated
  81. override void OnGetActivatedServer(PlayerBase player)
  82. {
  83. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  84. PlaySound(EPlayerSoundEventID.RATTLING_TEETH);
  85. }
  86. //!gets called once on a Symptom which is being activated
  87. override void OnGetActivatedClient(PlayerBase player)
  88. {
  89. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  90. }
  91. //!only gets called once on an active Symptom that is being deactivated
  92. override void OnGetDeactivatedServer(PlayerBase player)
  93. {
  94. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  95. }
  96. //!only gets called once on an active Symptom that is being deactivated
  97. override void OnGetDeactivatedClient(PlayerBase player)
  98. {
  99. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  100. }
  101. }