sneezestate.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. class SneezeSymptom 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 = 100;
  8. m_ID = SymptomIDs.SYMPTOM_SNEEZE;
  9. m_DestroyOnAnimFinish = true;
  10. m_SyncToClient = false;
  11. }
  12. //!gets called every frame
  13. override void OnUpdateServer(PlayerBase player, float deltatime)
  14. {
  15. }
  16. override void OnUpdateClient(PlayerBase player, float deltatime)
  17. {
  18. }
  19. //!gets called once on an Symptom which is being activated
  20. override void OnGetActivatedServer(PlayerBase player)
  21. {
  22. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  23. if( m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE && !player.IsRaised() && player.GetCommand_Move() && !player.GetCommand_Move().IsOnBack())
  24. {
  25. PlayAnimationADD(0);
  26. }
  27. else
  28. {
  29. PlaySound(EPlayerSoundEventID.SYMPTOM_SNEEZE);
  30. }
  31. player.SpreadAgentsEx(3);
  32. }
  33. //!gets called once on an Symptom which is being activated
  34. override void OnGetActivatedClient(PlayerBase player)
  35. {
  36. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  37. }
  38. //!only gets called once on an active Symptom that is being deactivated
  39. override void OnGetDeactivatedServer(PlayerBase player)
  40. {
  41. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  42. }
  43. //!only gets called once on an active Symptom that is being deactivated
  44. override void OnGetDeactivatedClient(PlayerBase player)
  45. {
  46. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  47. }
  48. override SmptAnimMetaBase SpawnAnimMetaObject()
  49. {
  50. return new SmptAnimMetaADD();
  51. }
  52. }