DayZ 1.24
Loading...
Searching...
No Matches
FeverBlurState.c
Go to the documentation of this file.
2{
3 Material m_MatGauss;
4
9 float m_Time;
11
12 const float BLUR_STRENGTH_MIN = 0.15;
13 const float BLUR_STRENGTH_MAX = 0.25;
14
15 const int BLUR_DURATION_TIME_MIN = 1.5;
16 const int BLUR_DURATION_TIME_MAX = 2.5;
17
18 const int MIN_TIME_BETWEEN_EFFECTS = 25.0;
19 const int MAX_TIME_BETWEEN_EFFECTS = 35.0;
20
21 //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
22 override void OnInit()
23 {
24 m_SymptomType = SymptomTypes.SECONDARY;
25 m_Priority = 0;
26 m_ID = SymptomIDs.SYMPTOM_FEVERBLUR;
27 m_DestroyOnAnimFinish = true;
28 m_IsPersistent = false;
29 m_SyncToClient = true;
30
31 if (!GetGame().IsDedicatedServer())
33 }
34
37 {
38 //int i = 1 + 1;
39 }
40
41
43 {
45 if (m_EffectStartTime <= 0)
46 {
47 m_EffectStartTime = Math.RandomFloatInclusive(MIN_TIME_BETWEEN_EFFECTS, MAX_TIME_BETWEEN_EFFECTS);
48 m_BlurDuration = Math.RandomFloatInclusive(BLUR_DURATION_TIME_MIN, BLUR_DURATION_TIME_MAX);
49 m_BlurStrength = Math.RandomFloat(BLUR_STRENGTH_MIN, BLUR_STRENGTH_MAX);
50 //PrintString("m_BlurDuration=" +m_BlurDuration.ToString());
51 }
52
53 if (m_EffectStartTime > 0 && m_Time > m_EffectStartTime)
54 {
55 m_EffectTime += deltatime / m_BlurDuration;
56 float cos_value = Math.Sin(m_EffectTime * Math.PI);
57 float val = cos_value * m_BlurStrength;
58 //Print(val);
59 m_Requester.SetFeverIntensity(val);
60 //PrintString("cos=" +cos_value.ToString());
61
62 if (m_EffectTime >= 1)
63 {
64 m_EffectTime = 0;
65 m_EffectStartTime = -1;
66 m_Time = 0;
67 }
68 }
69 }
70
73 {
74 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
75 }
76
78 {
79 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
80 }
81
83 {
84 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
85 }
86
89 {
90 m_Requester.Stop();
91 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
92 }
93}
int m_Priority
float m_Time
Definition CarScript.c:144
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
proto string ToString()
DayZPlayer m_Player
Definition Hand_Events.c:42
bool m_IsPersistent
int m_SymptomType
SymptomTypes
PPERUndergroundAcco m_Requester
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Debug.c:14
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:153
static bool IsSymptomLogEnable()
Definition Debug.c:789
Definition EnMath.c:7
override void OnGetActivatedClient(PlayerBase player)
override void OnInit()
float m_EffectStartTime
float m_BlurStrength
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
override void OnGetDeactivatedServer(PlayerBase player)
override void OnUpdateClient(PlayerBase player, float deltatime)
float m_EffectTime
PPERequester_FeverEffects m_Requester
float m_BlurDuration
override void OnUpdateServer(PlayerBase player, float deltatime)
gets called every frame
override void OnGetDeactivatedClient(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Sin(float angle)
Returns sinus of angle in radians.
static const float PI
Definition EnMath.c:12