DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс TrapBase

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

void OnServerSteppedOn (Object obj, string damageZone)
 
void CauseVictimToStartLimping (Object obj, string damagedZone)
 
void PlaySoundBiteLeg ()
 
void PlaySoundBiteEmpty ()
 
void PlaySoundOpen ()
 
override void OnActivate ()
 
override void OnDisarm ()
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override bool IsDeployable ()
 
override string GetLoopDeploySoundset ()
 
override void SetActions ()
 

Закрытые члены

void BearTrap ()
 
override bool CanBeDisarmed ()
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
override void CreateTrigger ()
 
override void OnUpdate (EntityAI victim)
 
override void OnSteppedOn (EntityAI victim)
 
override void OnSteppedOut (EntityAI victim)
 

Закрытые статические данные

static const int RAYCAST_SOURCES_COUNT = 5
 
static const vector m_RaycastSources [RAYCAST_SOURCES_COUNT]
 

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

Методы

◆ BearTrap()

void BearTrap ( )
inlineprivate
15 {
16 m_DamagePlayers = 5; // How much damage player gets when caught
17 m_DamageOthers = 5; // How much damage other entities(CreatureAI) gets when caught
18 m_DefectRate = 0;
19 m_InitWaitTime = 0.0; // After this time after deployment, the trap is activated
20 m_AnimationPhaseGrounded = "placing";
21 m_AnimationPhaseSet = "BearTrap_Set";
22 m_AnimationPhaseTriggered = "placing";
23 }
string m_AnimationPhaseTriggered
Definition TrapBase.c:34
float m_DefectRate
Definition TrapBase.c:19
string m_AnimationPhaseGrounded
Definition TrapBase.c:32
string m_AnimationPhaseSet
Definition TrapBase.c:33
float m_InitWaitTime
Definition TrapBase.c:17
float m_DamagePlayers
Definition TrapBase.c:20
float m_DamageOthers
Definition TrapBase.c:21

Перекрестные ссылки m_AnimationPhaseGrounded, m_AnimationPhaseSet, m_AnimationPhaseTriggered, m_DamageOthers, m_DamagePlayers, m_DefectRate и m_InitWaitTime.

◆ CanBeDisarmed()

override bool CanBeDisarmed ( )
inlineprivate
26 {
27 return true;
28 }

◆ CauseVictimToStartLimping()

void CauseVictimToStartLimping ( Object obj,
string damagedZone )
inlineprotected
178 {
181 if (Class.CastTo(player,obj))
182 {
183 player.DamageAllLegs(player.GetMaxHealth() * 2); //reduce legs health (not regular DamageSystem damage, does not transfer!)
184 }
185 else if (Class.CastTo(zombie,obj))
186 {
187 zombie.SetHealth("LeftLeg", "Health", 0.0);
188 zombie.SetHealth("RightLeg", "Health", 0.0);
189 }
190 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EntityAI.c:95
Definition PlayerBaseClient.c:2
Definition ZombieFemaleBase.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo().

Используется в OnServerSteppedOn().

◆ CreateTrigger()

override void CreateTrigger ( )
inlineprivate
44 {
45 super.CreateTrigger();
46
47 vector mins = "-0.1 -0.05 -0.1";
48 vector maxs = "0.1 0.4 0.1";
49
50 m_TrapTrigger.SetOrientation(GetOrientation());
53 }
vector GetOrientation()
Definition AreaDamageManager.c:306
TrapTrigger m_TrapTrigger
Definition TrapBase.c:44
void SetParentObject(TrapBase obj)
Definition TrapTrigger.c:18
void SetExtents(vector mins, vector maxs)
Set the size of the Trigger, avoid using SetCollisionBox directly.
Definition Trigger.c:116
Definition EnConvert.c:106

Перекрестные ссылки GetOrientation(), m_TrapTrigger, Trigger::SetExtents() и TrapTrigger::SetParentObject().

Используется в SetActive().

◆ EEHealthLevelChanged()

override void EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprivate
31 {
32 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
33
34 if (GetGame().IsServer())
35 {
37 {
39 }
40 }
41 }
void SetInactive(bool stop_timer=true)
Definition TrapBase.c:464
Definition constants.c:638
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:807

Перекрестные ссылки GetGame(), SetInactive() и GameConstants::STATE_RUINED.

◆ GetLoopDeploySoundset()

override string GetLoopDeploySoundset ( )
inlineprotected
245 {
246 return "beartrap_deploy_SoundSet";
247 }

◆ IsDeployable()

override bool IsDeployable ( )
inlineprotected
240 {
241 return true;
242 }

◆ OnActivate()

override void OnActivate ( )
inlineprotected
211 {
212 #ifndef SERVER
214 #endif
215 }
void PlaySoundOpen()
Definition Trap_Bear.c:204

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

Используется в SetActive().

◆ OnDisarm()

override void OnDisarm ( )
inlineprotected
218 {
219 #ifndef SERVER
221 #endif
222 }
void PlaySoundBiteEmpty()
Definition Trap_Bear.c:198

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

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

◆ OnPlacementComplete()

override void OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
inlineprotected
229 {
230 super.OnPlacementComplete(player, position, orientation);
231
232 if (GetGame().IsServer())
233 {
236 }
237 }
void StartActivate(PlayerBase player)
Definition TrapBase.c:443

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

◆ OnServerSteppedOn()

void OnServerSteppedOn ( Object obj,
string damageZone )
inlineprotected

Generic limp handling

137 {
138 if (obj.IsInherited(CarWheel))
139 {
140 obj.ProcessDirectDamage(DamageType.CLOSE_COMBAT, this, damageZone, "BearTrapHit_CarWheel", "0 0 0", 1);
141 if (m_UpdateTimer.IsRunning())
142 {
143 m_UpdateTimer.Stop();
144 }
145
146 SetInactive(false);
147 Synch(EntityAI.Cast(obj));
148
149 return;
150 }
151
152 if (obj.IsDamageDestroyed())
153 return;
154
155 string zoneUsed = damageZone;
156 if (damageZone == "zone_leg_random")
157 {
158 zoneUsed = "LeftLeg";
159 if (Math.RandomIntInclusive(0, 1) == 1)
160 zoneUsed = "RightLeg";
161 }
162
165 if (obj.IsInherited(PlayerBase) || (Class.CastTo(zombie,obj) && !zombie.IsCrawling() && Math.RandomIntInclusive(0, 1) == 1))
166 {
168 }
169
170 obj.ProcessDirectDamage(DamageType.CLOSE_COMBAT, this, zoneUsed, "BearTrapHit", "0 0 0", 1);
171
172 SetInactive(false);
173 Synch(EntityAI.Cast(obj));
174 }
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
ref Timer m_UpdateTimer
Definition RadialMenu.c:20
void Synch(EntityAI victim)
keeping "step" here for consistency only
Definition TrapBase.c:286
Definition InventoryItem.c:413
Definition Building.c:6
Definition EnMath.c:7
void CauseVictimToStartLimping(Object obj, string damagedZone)
Definition Trap_Bear.c:177
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки Class::CastTo(), CauseVictimToStartLimping(), m_UpdateTimer, Math::RandomIntInclusive(), SetInactive() и Synch().

Используется в OnSteppedOn(), OnUpdate() и OnUpdate().

◆ OnSteppedOn()

override void OnSteppedOn ( EntityAI victim)
inlineprivate

CarScript specific reaction on BearTrap

this is also called on client (OnRPC->SnapOn->OnSteppedOn chain)

68 {
69 if (GetGame().IsServer() && victim)
70 {
71 if (!victim.GetAllowDamage())
72 return;
73
74 if (victim.IsInherited(CarScript))
75 {
78 m_UpdateTimer.Run(UPDATE_TIMER_INTERVAL, this, "OnUpdate", params, true);
79
80 return;
81 }
82 else
83 {
85 {
87 vector raycastEnd = "0 0.5 0" + raycastStart;
88
90 rayInput.flags = CollisionFlags.ALLOBJECTS;
92 rayInput.radius = 0.05;
94
96 {
98 {
99 if (result.obj && !result.obj.IsDamageDestroyed() && !result.obj.IsAnyInherited({ItemBase, Plant}))
100 {
101 OnServerSteppedOn(result.obj, result.obj.GetDamageZoneNameByComponentIndex(result.component));
102 return;
103 }
104 }
105 }
106 }
107
108 OnServerSteppedOn(victim, "zone_leg_random");
109 }
110 }
111 else if (!GetGame().IsDedicatedServer())
112 {
113 if (victim)
114 {
115 if (victim.IsInherited(PlayerBase))
116 {
117 victim.SpawnDamageDealtEffect();
118 }
119
121 }
122 }
123 }
const float UPDATE_TIMER_INTERVAL
Definition TrapBase.c:15
Definition CivilianSedan.c:2
Definition DayZPhysics.c:124
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
Definition DayZPhysics.c:50
Definition DayZPhysics.c:99
void PlaySoundBiteLeg()
Definition Trap_Bear.c:192
void OnServerSteppedOn(Object obj, string damageZone)
Definition Trap_Bear.c:136
static const vector m_RaycastSources[RAYCAST_SOURCES_COUNT]
Definition Trap_Bear.c:6
CollisionFlags
Definition EnDebug.c:141

Перекрестные ссылки GetGame(), ItemBase, m_RaycastSources, m_UpdateTimer, OnServerSteppedOn(), PlaySoundBiteLeg(), DayZPhysics::RaycastRVProxy() и UPDATE_TIMER_INTERVAL.

Используется в SnapOnObject().

◆ OnSteppedOut()

override void OnSteppedOut ( EntityAI victim)
inlineprivate
126 {
127 if (victim.IsInherited(CarScript))
128 {
129 if (m_UpdateTimer && m_UpdateTimer.IsRunning())
130 {
131 m_UpdateTimer.Stop();
132 }
133 }
134 }

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

Используется в RemoveFromObject().

◆ OnUpdate()

override void OnUpdate ( EntityAI victim)
inlineprivate
56 {
57 if (victim && victim.IsInherited(CarScript))
58 {
60 if (wheel)
61 {
63 }
64 }
65 }
EntityAI GetClosestCarWheel(EntityAI victim)
Definition TrapBase.c:628

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

◆ PlaySoundBiteEmpty()

void PlaySoundBiteEmpty ( )
inlineprotected
199 {
200 EffectSound sound = SEffectManager.PlaySound("beartrapClose_SoundSet", GetPosition(), 0, 0, false);
201 sound.SetAutodestroy(true);
202 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Definition EffectManager.c:169

Перекрестные ссылки GetPosition и SEffectManager::PlaySound().

Используется в OnDisarm().

◆ PlaySoundBiteLeg()

void PlaySoundBiteLeg ( )
inlineprotected
193 {
194 EffectSound sound = SEffectManager.PlaySound("beartrapCloseDamage_SoundSet", GetPosition(), 0, 0, false);
195 sound.SetAutodestroy(true);
196 }

Перекрестные ссылки GetPosition и SEffectManager::PlaySound().

Используется в OnSteppedOn().

◆ PlaySoundOpen()

void PlaySoundOpen ( )
inlineprotected
205 {
206 EffectSound sound = SEffectManager.PlaySound("beartrapOpen_SoundSet", GetPosition(), 0, 0, false);
207 sound.SetAutodestroy(true);
208 }

Перекрестные ссылки GetPosition и SEffectManager::PlaySound().

Используется в OnActivate().

◆ SetActions()

override void SetActions ( )
inlineprotected
250 {
251 super.SetActions();
252
255 AddAction(ActionDeployObject);
256 }
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
Definition ActionClapBearTrapWithThisItem.c:2
Definition ActionTogglePlaceObject.c:2

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

Поля

◆ m_RaycastSources

const vector m_RaycastSources[RAYCAST_SOURCES_COUNT]
staticprivate
Инициализатор
= {
"0.0 0.1 0.0",
"0.2 0.1 0.2",
"-.2 0.1 0.2",
"0.2 0.1 -0.2",
"-0.2 0.1 -0.2"
}
6 {
7 "0.0 0.1 0.0", // center
8 "0.2 0.1 0.2", // north east
9 "-.2 0.1 0.2", // north west
10 "0.2 0.1 -0.2", // south east
11 "-0.2 0.1 -0.2" // south west
12 };

Используется в OnSteppedOn().

◆ RAYCAST_SOURCES_COUNT

const int RAYCAST_SOURCES_COUNT = 5
staticprivate

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