DayZ 1.24
Loading...
Searching...
No Matches
FliesMdfr Class Reference
Inheritance diagram for FliesMdfr:
[legend]
Collaboration diagram for FliesMdfr:
[legend]

Private Member Functions

override void Init ()
 
override bool ActivateCondition (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 
override void OnReconnect (PlayerBase player)
 
override void OnActivate (PlayerBase player)
 
override void OnDeactivate (PlayerBase player)
 

Private Attributes

const float DISTANCE_SENSITIVITY_SQR = Math.SqrFloat(0.05)
 
const int TICK_FREQUENCY = 15
 
const int IDLE_COUNT_THRESHOLD = 40
 
vector m_PrevPosition
 
int m_IdleCount
 

Detailed Description

Definition at line 1 of file Flies.c.

Member Function Documentation

◆ ActivateCondition()

override bool FliesMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 20 of file Flies.c.

21 {
22 return false;
23 }

◆ DeactivateCondition()

override bool FliesMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 25 of file Flies.c.

26 {
27 return false;
28 }

◆ Init()

override void FliesMdfr::Init ( )
inlineprivate

Definition at line 10 of file Flies.c.

11 {
13 m_ID = eModifiers.MDF_FLIES;
18 }
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
const int TICK_FREQUENCY
Definition Flies.c:4
eModifiers
Definition eModifiers.c:2

References DEFAULT_TICK_TIME_INACTIVE, DisableActivateCheck(), DisableDeactivateCheck(), m_ID, m_TickIntervalActive, m_TickIntervalInactive, m_TrackActivatedTime, and TICK_FREQUENCY.

◆ OnActivate()

override void FliesMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 61 of file Flies.c.

62 {
63 m_IdleCount = 0;
65 player.SetSynchDirty();
66 }
int m_IdleCount
Definition Flies.c:7
static const int CORPSE_STATE_DECAYED

References PlayerConstants::CORPSE_STATE_DECAYED, and m_IdleCount.

◆ OnDeactivate()

override void FliesMdfr::OnDeactivate ( PlayerBase player)
inlineprivate

Definition at line 68 of file Flies.c.

69 {
70
71 }

◆ OnReconnect()

override void FliesMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 56 of file Flies.c.

57 {
59 }
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1167

References OnActivate().

◆ OnTick()

override void FliesMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

Definition at line 30 of file Flies.c.

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 }
const int IDLE_COUNT_THRESHOLD
Definition Flies.c:5
const float DISTANCE_SENSITIVITY_SQR
Definition Flies.c:3
vector m_PrevPosition
Definition Flies.c:6
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.

References PlayerConstants::CORPSE_STATE_DECAYED, DISTANCE_SENSITIVITY_SQR, vector::DistanceSq(), IDLE_COUNT_THRESHOLD, m_IdleCount, and m_PrevPosition.

Member Data Documentation

◆ DISTANCE_SENSITIVITY_SQR

const float FliesMdfr::DISTANCE_SENSITIVITY_SQR = Math.SqrFloat(0.05)
private

Definition at line 3 of file Flies.c.

Referenced by OnTick().

◆ IDLE_COUNT_THRESHOLD

const int FliesMdfr::IDLE_COUNT_THRESHOLD = 40
private

Definition at line 5 of file Flies.c.

Referenced by OnTick().

◆ m_IdleCount

int FliesMdfr::m_IdleCount
private

Definition at line 7 of file Flies.c.

Referenced by OnActivate(), and OnTick().

◆ m_PrevPosition

vector FliesMdfr::m_PrevPosition
private

Definition at line 6 of file Flies.c.

Referenced by OnTick().

◆ TICK_FREQUENCY

const int FliesMdfr::TICK_FREQUENCY = 15
private

Definition at line 4 of file Flies.c.

Referenced by Init().


The documentation for this class was generated from the following file: