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

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

void Plastic_Explosive ()
 
override void EOnInit (IEntity other, int extra)
 
override void EEKilled (Object killer)
 special behaviour - do not call super from ExplosivesBase
 
override bool HasLockedTriggerSlots ()
 
override void LockTriggerSlots ()
 
override void UnlockTriggerSlots ()
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override void OnVariablesSynchronized ()
 
override void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanDisplayAttachmentSlot (int slot_id)
 
override bool IsTakeable ()
 
override bool IsDeployable ()
 
override void SetActions ()
 
override void OnWasAttached (EntityAI parent, int slot_id)
 
override void OnWasDetached (EntityAI parent, int slot_id)
 
override bool EEOnDamageCalculated (TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour ()
 
override void PairRemote (notnull EntityAI trigger)
 
override EntityAI GetPairDevice ()
 
override bool CanBeArmed ()
 
override bool CanBeDisarmed ()
 
override void OnActivatedByItem (notnull ItemBase item)
 
override void OnDisarmed (bool pWithTool)
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override void UpdateLED (int pState)
 
void OnTriggerAttached (EntityAI entity)
 
void OnTriggerDetached (EntityAI entity)
 
void UpdateVisuals (EntityAI entity)
 
override string GetDeploySoundset ()
 
override string GetLoopDeploySoundset ()
 
bool UsesGlobalDeploy ()
 

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

const string SLOT_TRIGGER = "TriggerRemoteDetonator_Receiver"
 
const string ANIM_PHASE_TRIGGER_REMOTE = "TriggerRemote"
 
bool m_UsedAsCharge
 
ref RemotelyActivatedItemBehaviour m_RAIB
 

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

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

◆ Plastic_Explosive()

void Plastic_Explosive ( )
inlineprotected
11 {
13
14 SetAmmoType("Plastic_Explosive_Ammo");
16
17 RegisterNetSyncVariableInt("m_RAIB.m_PairDeviceNetIdLow");
18 RegisterNetSyncVariableInt("m_RAIB.m_PairDeviceNetIdHigh");
19 }
void SetParticleExplosion(int particle)
Definition ExplosivesBase.c:294
void SetAmmoType(string pAmmoType)
Definition ExplosivesBase.c:283
Definition ParticleList.c:12
static const int PLASTIC_EXPLOSION
Definition ParticleList.c:319
ref RemotelyActivatedItemBehaviour m_RAIB
Definition Plastic_Explosive.c:8
Definition RemotelyActivatedItemBehaviour.c:2

Перекрестные ссылки m_RAIB, ParticleList::PLASTIC_EXPLOSION, SetAmmoType() и SetParticleExplosion().

Методы

◆ CanBeArmed()

override bool CanBeArmed ( )
inlineprotected
222 {
223 if (!super.CanBeArmed())
224 {
225 return false;
226 }
227
228 return HasLockedTriggerSlots() && !GetArmed();
229 }
bool GetArmed()
Definition ExplosivesBase.c:236
Definition EntityAI.c:95
override bool HasLockedTriggerSlots()
Definition Plastic_Explosive.c:34

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

◆ CanBeDisarmed()

override bool CanBeDisarmed ( )
inlineprotected
232 {
233 return GetArmed();
234 }

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

◆ CanDisplayAttachmentSlot()

override bool CanDisplayAttachmentSlot ( int slot_id)
inlineprotected
117 {
119
120 switch (slotName)
121 {
122 case SLOT_TRIGGER:
123 return FindAttachmentBySlotName(slotName) != null;
124 break;
125 }
126
127 return true;
128 }
PlayerSpawnPreset slotName
provides access to slot configuration
Definition InventorySlots.c:6
static proto native owned string GetSlotName(int id)
converts slot_id to string
const string SLOT_TRIGGER
Definition Plastic_Explosive.c:3

Перекрестные ссылки InventorySlots::GetSlotName(), SLOT_TRIGGER и slotName.

◆ CanReceiveAttachment()

override bool CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprotected
99 {
101 GetInventory().GetCurrentInventoryLocation(il);
102 if (il.GetType() == InventoryLocationType.HANDS)
103 {
104 return false;
105 }
106
107 ClockBase timer = ClockBase.Cast(attachment);
108 if (timer && !timer.IsAlarmOn())
109 {
110 return false;
111 }
112
113 return !GetArmed();
114 }
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
InventoryLocation.
Definition InventoryLocation.c:29

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

◆ EEHealthLevelChanged()

override void EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprotected
182 {
183 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
184
185 if (GetGame().IsServer())
186 {
188 {
189 for (int attachmentIdx = 0; attachmentIdx < GetInventory().AttachmentCount(); attachmentIdx++)
190 {
191 ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(attachmentIdx));
192 if (attachment)
193 {
194 attachment.UnlockFromParent();
195 attachment.SetHealth("", "", 0.0);
196 }
197 }
198
199 SetArmed(false);
200 SetTakeable(true);
201 }
202 }
203 }
void SetArmed(bool state)
Definition ExplosivesBase.c:241
override void SetTakeable(bool pState)
Definition ItemBase.c:9020
Definition constants.c:638
Definition InventoryItem.c:731
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:807

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

◆ EEItemAttached()

override void EEItemAttached ( EntityAI item,
string slot_name )
inlineprotected
296 {
297 super.EEItemAttached(item, slot_name);
298
299 if (slot_name == SLOT_TRIGGER)
301 }
void OnTriggerAttached(EntityAI entity)
Definition Plastic_Explosive.c:320

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

◆ EEItemDetached()

override void EEItemDetached ( EntityAI item,
string slot_name )
inlineprotected
304 {
305 super.EEItemDetached(item, slot_name);
306
307 if (slot_name == SLOT_TRIGGER)
309 }
void OnTriggerDetached(EntityAI entity)
Definition Plastic_Explosive.c:336

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

◆ EEItemLocationChanged()

override void EEItemLocationChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprotected
89 {
90 super.EEItemLocationChanged(oldLoc, newLoc);
91
92 if (m_RAIB)
93 {
94 m_RAIB.Pair();
95 }
96 }

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

◆ EEKilled()

override void EEKilled ( Object killer)
inlineprotected

special behaviour - do not call super from ExplosivesBase

29 {
30 //analytics (behaviour from EntityAI)
31 GetGame().GetAnalyticsServer().OnEntityKilled(killer, this);
32 }

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

◆ EEOnDamageCalculated()

override bool EEOnDamageCalculated ( TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos,
float speedCoef )
inlineprotected

ignores explosion damage from other Plastic_Explosive that are used as charge(like 2 PE fired via IED)

171 {
173 if (damageType == DamageType.EXPLOSION)
174 {
175 return !m_UsedAsCharge;
176 }
177
178 return true;
179 }
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
bool m_UsedAsCharge
Definition Plastic_Explosive.c:6

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

◆ EOnInit()

override void EOnInit ( IEntity other,
int extra )
inlineprotected
22 {
23 if (!g_Game.IsMultiplayer())
25 }
DayZGame g_Game
Definition DayZGame.c:3815
override void LockTriggerSlots()
Definition Plastic_Explosive.c:39

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

◆ GetDeploySoundset()

override string GetDeploySoundset ( )
inlineprotected
356 {
357 return "placeImprovisedExplosive_SoundSet";
358 }

◆ GetLoopDeploySoundset()

override string GetLoopDeploySoundset ( )
inlineprotected
361 {
362 return "improvisedexplosive_deploy_SoundSet";
363 }

◆ GetPairDevice()

override EntityAI GetPairDevice ( )
inlineprotected
217 {
218 return m_RAIB.GetPairDevice();
219 }

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

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

◆ GetRemotelyActivatedItemBehaviour()

override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour ( )
inlineprotected
206 {
207 return m_RAIB;
208 }

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

◆ HasLockedTriggerSlots()

override bool HasLockedTriggerSlots ( )
inlineprotected
35 {
36 return GetInventory().GetSlotLock(InventorySlots.GetSlotIdFromString(SLOT_TRIGGER));
37 }
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

Перекрестные ссылки InventorySlots::GetSlotIdFromString() и SLOT_TRIGGER.

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

◆ IsDeployable()

override bool IsDeployable ( )
inlineprotected
136 {
137 return !GetArmed();
138 }

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

◆ IsTakeable()

override bool IsTakeable ( )
inlineprotected
131 {
132 return !GetArmed() && super.IsTakeable();
133 }

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

◆ LockTriggerSlots()

override void LockTriggerSlots ( )
inlineprotected
40 {
41 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(SLOT_TRIGGER), true);
42 }

Перекрестные ссылки InventorySlots::GetSlotIdFromString() и SLOT_TRIGGER.

Используется в EOnInit(), OnDisarmed() и OnStoreSave().

◆ OnActivatedByItem()

override void OnActivatedByItem ( notnull ItemBase item)
inlineprotected
237 {
238 if (GetGame().IsServer())
239 {
240 if (GetHealthLevel("") == GameConstants.STATE_RUINED)
241 {
242 return;
243 }
244
245 if (item == this)
246 {
247 SetHealth("", "", 0.0);
249 return;
250 }
251
252 if (m_RAIB.IsPaired() && GetArmed())
253 {
254 if (GetPairDevice() == item)
255 {
256 SetHealth("", "", 0.0);
258 }
259 }
260 }
261 }
void InitiateExplosion()
Definition ExplosivesBase.c:160
override EntityAI GetPairDevice()
Definition Plastic_Explosive.c:216

Перекрестные ссылки GetArmed(), GetGame(), GetPairDevice(), InitiateExplosion(), m_RAIB и GameConstants::STATE_RUINED.

◆ OnDisarmed()

override void OnDisarmed ( bool pWithTool)
inlineprotected
264 {
265 super.OnDisarmed(pWithTool);
266
267 UnpairRemote();
269
270 for (int att = 0; att < GetInventory().AttachmentCount(); att++)
271 {
272 ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(att));
273 if (attachment)
274 {
275 attachment.UnlockFromParent();
276 if (attachment.IsInherited(RemoteDetonator))
277 {
278 if (pWithTool)
279 {
280 GetInventory().DropEntity(InventoryMode.SERVER, this, attachment);
281 attachment.SetHealth("", "", 0.0);
282 }
283 else
284 {
285 attachment.Delete();
286 }
287 }
288 }
289 }
290
292 SetTakeable(true);
293 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
void UpdateVisuals()
Definition Construction.c:188
override void UnpairRemote()
Definition ExplosivesBase.c:120

Перекрестные ссылки LockTriggerSlots(), SetTakeable(), UnpairRemote() и UpdateVisuals().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected
50 {
51 if (!super.OnStoreLoad(ctx, version))
52 return false;
53
54 if (version <= 134) // up to 1.21
55 {
57 bool locked = GetInventory().GetSlotLock(slotId);
58 while (locked)
59 {
60 GetInventory().SetSlotLock(slotId, false);
61 locked = GetInventory().GetSlotLock(slotId);
62 }
63 }
64
65 return true;
66 }

Перекрестные ссылки InventorySlots::GetSlotIdFromString() и SLOT_TRIGGER.

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext ctx)
inlineprotected
69 {
70 super.OnStoreSave(ctx);
71
73 }

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

◆ OnTriggerAttached()

void OnTriggerAttached ( EntityAI entity)
inlineprotected
321 {
322 Arm();
325
326 for (int att = 0; att < GetInventory().AttachmentCount(); att++)
327 {
328 ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(att));
329 if (attachment)
330 {
331 attachment.LockToParent();
332 }
333 }
334 }
void Arm()
Definition ExplosivesBase.c:207
ERemoteDetonatorLEDState
Definition RemoteDetonator.c:2
override void UpdateLED(int pState)
Definition Plastic_Explosive.c:311

Перекрестные ссылки Arm(), UpdateLED() и UpdateVisuals().

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

◆ OnTriggerDetached()

void OnTriggerDetached ( EntityAI entity)
inlineprotected

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

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

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
inlineprotected
76 {
77 super.OnVariablesSynchronized();
78
79 if (m_RAIB)
80 {
81 m_RAIB.OnVariableSynchronized();
82 }
83
85 UpdateVisuals(GetInventory().FindAttachment(slotId));
86 }

Перекрестные ссылки InventorySlots::GetSlotIdFromString(), m_RAIB, SLOT_TRIGGER и UpdateVisuals().

◆ OnWasAttached()

override void OnWasAttached ( EntityAI parent,
int slot_id )
inlineprotected
149 {
150 super.OnWasAttached(parent, slot_id);
151
152 m_UsedAsCharge = false;
153
154 if (parent && parent.IsInherited(ExplosivesBase))
155 {
156 m_UsedAsCharge = true;
157 }
158 }

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

◆ OnWasDetached()

override void OnWasDetached ( EntityAI parent,
int slot_id )
inlineprotected
161 {
162 super.OnWasDetached(parent, slot_id);
163
164 if (parent && !parent.IsInherited(ExplosivesBase))
165 {
166 m_UsedAsCharge = false;
167 }
168 }

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

◆ PairRemote()

override void PairRemote ( notnull EntityAI trigger)
inlineprotected
211 {
212 m_RAIB.Pair(trigger);
213 }

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

◆ SetActions()

override void SetActions ( )
inlineprotected
141 {
142 super.SetActions();
143
145 AddAction(ActionDeployObject);
146 }
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
Definition ActionTogglePlaceObject.c:2

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

◆ UnlockTriggerSlots()

override void UnlockTriggerSlots ( )
inlineprotected
45 {
46 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString(SLOT_TRIGGER), false);
47 }

Перекрестные ссылки InventorySlots::GetSlotIdFromString() и SLOT_TRIGGER.

◆ UpdateLED()

override void UpdateLED ( int pState)
inlineprotected
312 {
314 if (receiver)
315 {
316 receiver.UpdateLED(pState, true);
317 }
318 }
RemoteDetonatorTrigger RemoteDetonator RemoteDetonatorReceiver()
Definition RemoteDetonator.c:227

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

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

◆ UpdateVisuals()

void UpdateVisuals ( EntityAI entity)
inlineprotected
343 {
344 if (entity)
345 {
346 SetAnimationPhase(ANIM_PHASE_TRIGGER_REMOTE, 0.0);
347 }
348 else
349 {
350 SetAnimationPhase(ANIM_PHASE_TRIGGER_REMOTE, 1.0);
351 }
352 }
const string ANIM_PHASE_TRIGGER_REMOTE
Definition Plastic_Explosive.c:4

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

◆ UsesGlobalDeploy()

bool UsesGlobalDeploy ( )
inlineprotected
366 {
367 return true;
368 }

Поля

◆ ANIM_PHASE_TRIGGER_REMOTE

const string ANIM_PHASE_TRIGGER_REMOTE = "TriggerRemote"
protected

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

◆ m_RAIB

◆ m_UsedAsCharge

bool m_UsedAsCharge
protected

Используется в EEOnDamageCalculated(), OnWasAttached() и OnWasDetached().

◆ SLOT_TRIGGER


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