DayZ 1.24
Loading...
Searching...
No Matches
Flies.c
Go to the documentation of this file.
2{
3 const float DISTANCE_SENSITIVITY_SQR = Math.SqrFloat(0.05/*actual distance in meters*/);
4 const int TICK_FREQUENCY = 15;
5 const int IDLE_COUNT_THRESHOLD = 40;
8
9
19
21 {
22 return false;
23 }
24
26 {
27 return false;
28 }
29
30 override void OnTick(PlayerBase player, float deltaT)
31 {
32 float dist_sqr = vector.DistanceSq(player.GetPosition(), m_PrevPosition);
33 if (dist_sqr < DISTANCE_SENSITIVITY_SQR)//has the player stayed still since last check
35 else
36 {
37 if (m_IdleCount >= IDLE_COUNT_THRESHOLD) //disable the effect
38 {
40 player.SetSynchDirty();
41 }
42
43 m_IdleCount = 0;//player moved, reset the count
44 }
45 m_PrevPosition = player.GetPosition();
46
47 if (m_IdleCount == IDLE_COUNT_THRESHOLD)//should we play the effect ?
48 {
50 player.SetSynchDirty();
51 }
52
53
54 }
55
57 {
59 }
60
62 {
63 m_IdleCount = 0;
65 player.SetSynchDirty();
66 }
67
69 {
70
71 }
72
73
74};
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
void DisableDeactivateCheck()
void DisableActivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
override void OnActivate(PlayerBase player)
Definition Flies.c:61
override void OnReconnect(PlayerBase player)
Definition Flies.c:56
const int IDLE_COUNT_THRESHOLD
Definition Flies.c:5
override bool DeactivateCondition(PlayerBase player)
Definition Flies.c:25
const float DISTANCE_SENSITIVITY_SQR
Definition Flies.c:3
const int TICK_FREQUENCY
Definition Flies.c:4
vector m_PrevPosition
Definition Flies.c:6
int m_IdleCount
Definition Flies.c:7
override bool ActivateCondition(PlayerBase player)
Definition Flies.c:20
override void OnDeactivate(PlayerBase player)
Definition Flies.c:68
override void Init()
Definition Flies.c:10
override void OnTick(PlayerBase player, float deltaT)
Definition Flies.c:30
Definition EnMath.c:7
static const int CORPSE_STATE_DECAYED
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
eModifiers
Definition eModifiers.c:2
static proto float SqrFloat(float f)
Returns squared value.
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1167