4 protected float m_CurrentTime = 0.0;
6 protected float m_PreviousTime = 0.0;
8 protected float m_AccumulatedTime = 0.0;
10 protected float m_LoopInterval = 1.0;
13 protected int m_AmountOfLoops = 0;
16 protected bool m_LoopByObject =
true;
20 m_LoopByObject = loopByObject;
24 override void OnTriggerCreated()
26 super.OnTriggerCreated();
28 m_PreviousTime =
g_Game.GetTickTime();
29 m_AccumulatedTime = 0.0;
32 override void SetLoopInterval(
float time )
34 m_LoopInterval = time;
39 super.OnEnterServerEvent(insider);
46 override void OnStayStartServerEvent(
int nrOfInsiders)
48 super.OnStayStartServerEvent(nrOfInsiders);
50 m_CurrentTime =
g_Game.GetTickTime();
51 m_AccumulatedTime += m_CurrentTime - m_PreviousTime;
52 m_PreviousTime = m_CurrentTime;
54 m_AmountOfLoops = m_AccumulatedTime / m_LoopInterval;
57 override void OnStayServerEvent(
TriggerInsider insider,
float deltaTime)
59 super.OnStayServerEvent(insider, deltaTime);
65 override void OnStayFinishServerEvent()
67 super.OnStayFinishServerEvent();
69 m_AccumulatedTime -= m_AmountOfLoops * m_LoopInterval;
74 override protected float CalculateDamageScale(
TriggerInsider insider,
float deltaTime)
79 float lastDamaged = 0;
82 if ( CastTo( dInsider, insider ) )
83 lastDamaged = dInsider.lastDamaged;
91 float damageCoeff = (m_CurrentTime - lastDamaged) / m_LoopInterval;
92 if ( damageCoeff >= 1 )
99 return m_AmountOfLoops;