painlightstate.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. class PainLightSymptom 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_PAIN_LIGHT;
  9. m_SyncToClient = true;
  10. m_MaxCount = 2;
  11. m_Duration = 1;
  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())
  31. Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  32. PlaySound(EPlayerSoundEventID.TAKING_DMG_LIGHT);
  33. }
  34. //!gets called once on a Symptom which is being activated
  35. override void OnGetActivatedClient(PlayerBase player)
  36. {
  37. //player.SpawnShockEffect(0.5);
  38. CachedObjectsParams.PARAM2_FLOAT_FLOAT.param1 = 26;
  39. CachedObjectsParams.PARAM2_FLOAT_FLOAT.param2 = 0.25;
  40. player.SpawnDamageDealtEffect2(CachedObjectsParams.PARAM2_FLOAT_FLOAT);
  41. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
  42. }
  43. //!only gets called once on an active Symptom that is being deactivated
  44. override void OnGetDeactivatedServer(PlayerBase player)
  45. {
  46. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  47. }
  48. //!only gets called once on an active Symptom that is being deactivated
  49. override void OnGetDeactivatedClient(PlayerBase player)
  50. {
  51. if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
  52. }
  53. }