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

Protected Member Functions

void OnStayClientEvent (TriggerInsider insider, float deltaTime)
 
override void OnEnterServerEvent (TriggerInsider insider)
 
override void OnEnterClientEvent (TriggerInsider insider)
 
override void OnLeaveServerEvent (TriggerInsider insider)
 
override void OnLeaveClientEvent (TriggerInsider insider)
 
override bool ShouldRemoveInsider (TriggerInsider insider)
 

Static Protected Member Functions

static void TriggerEffect (EntityAI insider, typename triggerType)
 

Private Member Functions

override void OnEnterServerEvent (TriggerInsider insider)
 
override void OnLeaveServerEvent (TriggerInsider insider)
 
override void OnEnterClientEvent (TriggerInsider insider)
 
override void OnLeaveClientEvent (TriggerInsider insider)
 
override void OnStayStartServerEvent (int nrOfInsiders)
 
override void OnStayFinishServerEvent ()
 
override void OnStayServerEvent (TriggerInsider insider, float deltaTime)
 
override string GetAmbientSoundsetName ()
 
void EffectTrigger ()
 
void SetLocalEffects (int aroundPartId, int tinyPartId, int ppeRequesterIdx)
 
EffectArea GetEffectArea ()
 
void Init (EffectArea area, int priority)
 
int GetEffectsPriority ()
 
string GetAmbientSoundsetName ()
 
void SetupClientEffects (bool enable, notnull PlayerBase player)
 
override void EOnFrame (IEntity other, float timeSlice)
 
override bool CanAddObjectAsInsider (Object object)
 

Private Attributes

const float DAMAGE_TICK_RATE = 10
 
int m_AroundPartId
 
int m_TinyPartId
 
int m_PPERequester
 
float m_DeltaTime
 
float m_TimeAccuStay
 
bool m_DealDamageFlag
 
TriggerEffectManager m_Manager
 
EffectArea m_EffectArea
 
int m_EffectsPriority
 

Detailed Description

Definition at line 2 of file ContaminatedTrigger.c.

Constructor & Destructor Documentation

◆ EffectTrigger()

void EffectTrigger::EffectTrigger ( )
inlineprivate

Definition at line 15 of file EffectTrigger.c.

16 {
17 RegisterNetSyncVariableInt("m_AroundPartId");
18 RegisterNetSyncVariableInt("m_TinyPartId");
19 RegisterNetSyncVariableInt("m_PPERequester");
20 RegisterNetSyncVariableInt("m_EffectsPriority");
21
24 }
TriggerEffectManager m_Manager
void RegisterTriggerType(EffectTrigger effectTrigger)
static TriggerEffectManager GetInstance()

References TriggerEffectManager::GetInstance(), m_Manager, and TriggerEffectManager::RegisterTriggerType().

Member Function Documentation

◆ CanAddObjectAsInsider()

override bool EffectTrigger::CanAddObjectAsInsider ( Object object)
inlineprivate

Definition at line 81 of file EffectTrigger.c.

82 {
83#ifdef SERVER
85 if (creature)
86 return !creature.ResistContaminatedEffect();
87 else
88 {
89 PlayerBase player = PlayerBase.Cast(object);
90 return player != null;
91 }
92#else
93 PlayerBase player = PlayerBase.Cast(object);
94 return (player && player.IsControlledPlayer());
95#endif
96 }
do not process rotations !
Definition DayZAnimal.c:573

◆ EOnFrame()

override void EffectTrigger::EOnFrame ( IEntity other,
float timeSlice )
inlineprivate

Definition at line 76 of file EffectTrigger.c.

77 {
79 }

References m_DeltaTime.

◆ GetAmbientSoundsetName() [1/2]

override string EffectTrigger::GetAmbientSoundsetName ( )
inlineprivate

Definition at line 79 of file ContaminatedTrigger.c.

80 {
81 return "ContaminatedArea_SoundSet";
82 }

Referenced by OnStayClientEvent(), and SetupClientEffects().

◆ GetAmbientSoundsetName() [2/2]

string EffectTrigger::GetAmbientSoundsetName ( )
inlineprivate

Definition at line 55 of file EffectTrigger.c.

56 {
57 return "";
58 }

◆ GetEffectArea()

EffectArea EffectTrigger::GetEffectArea ( )
inlineprivate

Definition at line 39 of file EffectTrigger.c.

40 {
41 return m_EffectArea;
42 }
EffectArea m_EffectArea

References m_EffectArea.

◆ GetEffectsPriority()

int EffectTrigger::GetEffectsPriority ( )
inlineprivate

Definition at line 50 of file EffectTrigger.c.

51 {
52 return m_EffectsPriority;
53 }

References m_EffectsPriority.

Referenced by ManBase::RequestTriggerEffect().

◆ Init()

void EffectTrigger::Init ( EffectArea area,
int priority )
inlineprivate

Definition at line 44 of file EffectTrigger.c.

References m_EffectArea, and m_EffectsPriority.

Referenced by EffectArea::CreateTrigger().

◆ OnEnterClientEvent() [1/2]

override void EffectTrigger::OnEnterClientEvent ( TriggerInsider insider)
inlineprivate

Definition at line 38 of file ContaminatedTrigger.c.

39 {
40 super.OnEnterClientEvent(insider);
41 }

◆ OnEnterClientEvent() [2/2]

override void EffectTrigger::OnEnterClientEvent ( TriggerInsider insider)
inlineprotected

Definition at line 123 of file EffectTrigger.c.

124 {
125 super.OnEnterClientEvent(insider);
126
127 if (insider)
128 {
130
131 // We will only handle the controlled player, as effects are only relevant to this player instance
132 if (playerInsider && playerInsider.IsControlledPlayer())
133 {
134 //SetupClientEffects(true, playerInsider);
135 // We then handle the update of player trigger state in manager
137 }
138 }
139 }
void OnPlayerEnter(notnull PlayerBase player, notnull EffectTrigger trigger)
Object GetObject()
Definition Trigger.c:28

References TriggerInsider::GetObject(), m_Manager, and TriggerEffectManager::OnPlayerEnter().

◆ OnEnterServerEvent() [1/2]

override void EffectTrigger::OnEnterServerEvent ( TriggerInsider insider)
inlineprivate

Definition at line 10 of file ContaminatedTrigger.c.

11 {
12 super.OnEnterServerEvent(insider);
13 //Print("Entered A " + GetType());
14 if (insider)
15 {
17
18 if (creature)
19 creature.IncreaseEffectTriggerCount();
20 }
21
22 }

References TriggerInsider::GetObject().

◆ OnEnterServerEvent() [2/2]

override void EffectTrigger::OnEnterServerEvent ( TriggerInsider insider)
inlineprotected

Definition at line 106 of file EffectTrigger.c.

107 {
108 super.OnEnterServerEvent(insider);
109
110 // We don't need to test the trigger count as Modifiers handle such cases already
111 if (insider)
112 {
114
115 if (playerInsider)
116
118
119 }
120
121 }

References TriggerInsider::GetObject(), m_Manager, and TriggerEffectManager::OnPlayerEnter().

◆ OnLeaveClientEvent() [1/2]

override void EffectTrigger::OnLeaveClientEvent ( TriggerInsider insider)
inlineprivate

Definition at line 43 of file ContaminatedTrigger.c.

44 {
45 super.OnLeaveClientEvent(insider);
46 }

◆ OnLeaveClientEvent() [2/2]

override void EffectTrigger::OnLeaveClientEvent ( TriggerInsider insider)
inlineprotected

Definition at line 156 of file EffectTrigger.c.

157 {
158 super.OnLeaveClientEvent(insider);
159
160 if (insider)
161 {
162 // Make sure you pass the set variable for PPE effect
163 // It will not remove the correct one if START and STOP don't point to the same Requester
165
166 // We will only handle the controlled player, as effects are only relevant to this player instance
167 if (playerInsider && playerInsider.IsControlledPlayer())
168 {
169 // We first handle the update of player trigger state in manager
171 //SetupClientEffects(false, playerInsider);
172 }
173 }
174 }
void OnPlayerExit(notnull PlayerBase player, notnull EffectTrigger trigger)

References TriggerInsider::GetObject(), m_Manager, and TriggerEffectManager::OnPlayerExit().

◆ OnLeaveServerEvent() [1/2]

override void EffectTrigger::OnLeaveServerEvent ( TriggerInsider insider)
inlineprivate

Definition at line 24 of file ContaminatedTrigger.c.

25 {
26 super.OnLeaveServerEvent(insider);
27 //Print("Left A " + GetType());
28 if (insider)
29 {
31
32 if (creature)
33 creature.DecreaseEffectTriggerCount();
34
35 }
36 }

References TriggerInsider::GetObject().

◆ OnLeaveServerEvent() [2/2]

override void EffectTrigger::OnLeaveServerEvent ( TriggerInsider insider)
inlineprotected

Definition at line 142 of file EffectTrigger.c.

143 {
144 super.OnLeaveServerEvent(insider);
145
146 if (insider)
147 {
149
150 if (playerInsider)
152 }
153 }

References TriggerInsider::GetObject(), m_Manager, and TriggerEffectManager::OnPlayerExit().

◆ OnStayClientEvent()

void EffectTrigger::OnStayClientEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected

Definition at line 98 of file EffectTrigger.c.

99 {
100 super.OnStayClientEvent(insider, deltaTime);
101 PlayerBase player = PlayerBase.Cast(insider.GetObject());
102 if (player)
104 }
override string GetAmbientSoundsetName()

References GetAmbientSoundsetName(), TriggerInsider::GetObject(), m_AroundPartId, m_PPERequester, and m_TinyPartId.

◆ OnStayFinishServerEvent()

override void EffectTrigger::OnStayFinishServerEvent ( )
inlineprivate

Definition at line 60 of file ContaminatedTrigger.c.

61 {
62 if (m_DealDamageFlag) //the flag was previously set to true, the insiders have been updated at this point, reset the flag and the timer as well
63 {
65 m_DealDamageFlag = false;
66 }
67 }
float m_TimeAccuStay

◆ OnStayServerEvent()

override void EffectTrigger::OnStayServerEvent ( TriggerInsider insider,
float deltaTime )
inlineprivate

Definition at line 69 of file ContaminatedTrigger.c.

70 {
72 {
74 if (creature && creature.m_EffectTriggerCount != 0)
75 creature.DecreaseHealth("", "", GameConstants.AI_CONTAMINATION_DMG_PER_SEC * m_TimeAccuStay / creature.m_EffectTriggerCount);// we devide by m_EffectTriggerCount for multiple trigger presence(overlapping triggers)
76 }
77 }
const float AI_CONTAMINATION_DMG_PER_SEC
Definition constants.c:916

References GameConstants::AI_CONTAMINATION_DMG_PER_SEC, and TriggerInsider::GetObject().

◆ OnStayStartServerEvent()

override void EffectTrigger::OnStayStartServerEvent ( int nrOfInsiders)
inlineprivate

Definition at line 49 of file ContaminatedTrigger.c.

50 {
53 {
54 m_DealDamageFlag = true;
55 //this is where we would normally reset the m_TimeAccuStay, but we need the value as deltaT when dealing damage to the insiders, so we reset it only after the insider update in OnStayFinishServerEvent
56 }
57
58 }
const float DAMAGE_TICK_RATE

◆ SetLocalEffects()

void EffectTrigger::SetLocalEffects ( int aroundPartId,
int tinyPartId,
int ppeRequesterIdx )
inlineprivate

Definition at line 30 of file EffectTrigger.c.

31 {
35
36 SetSynchDirty();
37 }

References m_AroundPartId, m_PPERequester, and m_TinyPartId.

Referenced by EffectArea::CreateTrigger().

◆ SetupClientEffects()

void EffectTrigger::SetupClientEffects ( bool enable,
notnull PlayerBase player )
inlineprivate

Definition at line 60 of file EffectTrigger.c.

61 {
63 {
64 if (enable)
66 else
67 player.SetContaminatedEffectEx(false, m_PPERequester);
68 }
69 }
bool IsPlayerInTriggerType(notnull PlayerBase player, notnull EffectTrigger trigger)

References GetAmbientSoundsetName(), TriggerEffectManager::IsPlayerInTriggerType(), m_AroundPartId, m_Manager, m_PPERequester, and m_TinyPartId.

◆ ShouldRemoveInsider()

override bool EffectTrigger::ShouldRemoveInsider ( TriggerInsider insider)
inlineprotected

Definition at line 177 of file EffectTrigger.c.

178 {
179 return !insider.GetObject().IsAlive();
180 }

References TriggerInsider::GetObject().

◆ TriggerEffect()

static void EffectTrigger::TriggerEffect ( EntityAI insider,
typename triggerType  )
inlinestaticprotected

Definition at line 184 of file EffectTrigger.c.

184{}

Member Data Documentation

◆ DAMAGE_TICK_RATE

const float EffectTrigger::DAMAGE_TICK_RATE = 10
private

Definition at line 4 of file ContaminatedTrigger.c.

◆ m_AroundPartId

int EffectTrigger::m_AroundPartId
private

Definition at line 5 of file EffectTrigger.c.

Referenced by OnStayClientEvent(), SetLocalEffects(), and SetupClientEffects().

◆ m_DealDamageFlag

bool EffectTrigger::m_DealDamageFlag
private

Definition at line 10 of file EffectTrigger.c.

◆ m_DeltaTime

float EffectTrigger::m_DeltaTime
private

Definition at line 8 of file EffectTrigger.c.

Referenced by EOnFrame().

◆ m_EffectArea

EffectArea EffectTrigger::m_EffectArea
private

Definition at line 12 of file EffectTrigger.c.

Referenced by GetEffectArea(), and Init().

◆ m_EffectsPriority

int EffectTrigger::m_EffectsPriority
private

Definition at line 13 of file EffectTrigger.c.

Referenced by GetEffectsPriority(), and Init().

◆ m_Manager

◆ m_PPERequester

int EffectTrigger::m_PPERequester
private

◆ m_TimeAccuStay

float EffectTrigger::m_TimeAccuStay
private

Definition at line 9 of file EffectTrigger.c.

◆ m_TinyPartId

int EffectTrigger::m_TinyPartId
private

Definition at line 6 of file EffectTrigger.c.

Referenced by OnStayClientEvent(), SetLocalEffects(), and SetupClientEffects().


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