Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс AreaDamageLooped
+ Граф наследования:AreaDamageLooped:

Защищенные члены

void AreaDamageLooped (EntityAI parent, bool loopByObject=true)
 
override void OnTriggerCreated ()
 Gets called when the trigger is spawned, so is the start and also a reset.
 
override void SetLoopInterval (float time)
 
override void OnEnterServerEvent (TriggerInsider insider)
 
override void OnStayStartServerEvent (int nrOfInsiders)
 
override void OnStayServerEvent (TriggerInsider insider, float deltaTime)
 
override void OnStayFinishServerEvent ()
 
float CalculateDamageScale (TriggerInsider insider, float deltaTime)
 

Защищенные данные

float m_CurrentTime = 0.0
 Current start time in seconds.
 
float m_PreviousTime = 0.0
 Previous start time in seconds.
 
float m_AccumulatedTime = 0.0
 How much time has accumulated.
 
float m_LoopInterval = 1.0
 Loop interval in seconds.
 
int m_AmountOfLoops = 0
 Caching of the amount of loops that will be performed in this frame.
 
bool m_LoopByObject = true
 Decides if the looping will be using the Object as reference or the time since last update loop.
 

Подробное описание

Конструктор(ы)

◆ AreaDamageLooped()

void AreaDamageLooped ( EntityAI parent,
bool loopByObject = true )
inlineprotected
19 {
21 }
bool m_LoopByObject
Decides if the looping will be using the Object as reference or the time since last update loop.
Definition AreaDamageLooped.c:16
Definition EntityAI.c:95

Перекрестные ссылки m_LoopByObject.

Методы

◆ CalculateDamageScale()

float CalculateDamageScale ( TriggerInsider insider,
float deltaTime )
inlineprotected
75 {
76 // If we want the LoopInterval to be dependant on the Object, we will need their lastDamaged time
78 {
79 float lastDamaged = 0;
80
82 if ( CastTo( dInsider, insider ) )
83 lastDamaged = dInsider.lastDamaged;
84
85 // First time it is damaged, do full damage
86 if (lastDamaged == 0)
87 return 1;
88
89 // This way, in case the server lags, it will scale the damage to catch up if necessary
90 // We want to wait until it is at least above 1, to not spam the network with hit messages
91 float damageCoeff = (m_CurrentTime - lastDamaged) / m_LoopInterval;
92 if ( damageCoeff >= 1 )
93 return damageCoeff;
94
95 return 0;
96 }
97 else
98 {
99 return m_AmountOfLoops;
100 }
101 }
float m_CurrentTime
Current start time in seconds.
Definition AreaDamageLooped.c:4
float m_LoopInterval
Loop interval in seconds.
Definition AreaDamageLooped.c:10
int m_AmountOfLoops
Caching of the amount of loops that will be performed in this frame.
Definition AreaDamageLooped.c:13
Extended TriggerInsider for AreaDamageTriggerBase.
Definition AreaDamageTriggerBase.c:3

Перекрестные ссылки m_AmountOfLoops, m_CurrentTime, m_LoopByObject и m_LoopInterval.

◆ OnEnterServerEvent()

override void OnEnterServerEvent ( TriggerInsider insider)
inlineprotected
38 {
39 super.OnEnterServerEvent(insider);
40
41 // Do direct damaging first time on entering
43 OnEvaluateDamageEx(insider, 1);
44 }
bool OnEvaluateDamageEx(TriggerInsider insider, float deltaTime)
Definition AreaDamageManager.c:218

Перекрестные ссылки m_LoopByObject и OnEvaluateDamageEx().

◆ OnStayFinishServerEvent()

override void OnStayFinishServerEvent ( )
inlineprotected
66 {
67 super.OnStayFinishServerEvent();
68
70 }
float m_AccumulatedTime
How much time has accumulated.
Definition AreaDamageLooped.c:8

Перекрестные ссылки m_AccumulatedTime, m_AmountOfLoops и m_LoopInterval.

◆ OnStayServerEvent()

override void OnStayServerEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected
58 {
59 super.OnStayServerEvent(insider, deltaTime);
60
61 // As we are using the Ex variant, we can put the logic in CalculateDamageScale
63 }

Перекрестные ссылки OnEvaluateDamageEx().

◆ OnStayStartServerEvent()

override void OnStayStartServerEvent ( int nrOfInsiders)
inlineprotected
47 {
48 super.OnStayStartServerEvent(nrOfInsiders);
49
50 m_CurrentTime = g_Game.GetTickTime();
53
55 }
DayZGame g_Game
Definition DayZGame.c:3746
float m_PreviousTime
Previous start time in seconds.
Definition AreaDamageLooped.c:6

Перекрестные ссылки g_Game, m_AccumulatedTime, m_AmountOfLoops, m_CurrentTime, m_LoopInterval и m_PreviousTime.

◆ OnTriggerCreated()

override void OnTriggerCreated ( )
inlineprotected

Gets called when the trigger is spawned, so is the start and also a reset.

25 {
26 super.OnTriggerCreated();
27
28 m_PreviousTime = g_Game.GetTickTime();
30 }

Перекрестные ссылки g_Game, m_AccumulatedTime и m_PreviousTime.

◆ SetLoopInterval()

override void SetLoopInterval ( float time)
inlineprotected
33 {
35 }

Перекрестные ссылки m_LoopInterval.

Поля

◆ m_AccumulatedTime

float m_AccumulatedTime = 0.0
protected

How much time has accumulated.

Используется в OnStayFinishServerEvent(), OnStayStartServerEvent() и OnTriggerCreated().

◆ m_AmountOfLoops

int m_AmountOfLoops = 0
protected

Caching of the amount of loops that will be performed in this frame.

Используется в CalculateDamageScale(), OnStayFinishServerEvent() и OnStayStartServerEvent().

◆ m_CurrentTime

float m_CurrentTime = 0.0
protected

Current start time in seconds.

Используется в CalculateDamageScale() и OnStayStartServerEvent().

◆ m_LoopByObject

bool m_LoopByObject = true
protected

Decides if the looping will be using the Object as reference or the time since last update loop.

Используется в AreaDamageLooped(), CalculateDamageScale() и OnEnterServerEvent().

◆ m_LoopInterval

float m_LoopInterval = 1.0
protected

Loop interval in seconds.

Используется в CalculateDamageScale(), OnStayFinishServerEvent(), OnStayStartServerEvent() и SetLoopInterval().

◆ m_PreviousTime

float m_PreviousTime = 0.0
protected

Previous start time in seconds.

Используется в OnStayStartServerEvent() и OnTriggerCreated().


Объявления и описания членов класса находятся в файле: