Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
trapbase.c
Go to the documentation of this file.
2 {
3  ACTIVATING = 5,
4 }
5 
6 class TrapBase extends ItemBase
7 {
8  #ifdef SERVER
9  protected const int SPAWN_FLAGS = ECE_CREATEPHYSICS;
10  #else
11  protected const int SPAWN_FLAGS = ECE_LOCAL;
12  #endif
13 
14  protected const int DAMAGE_TRIGGER_MINE = 75;
15  protected const float UPDATE_TIMER_INTERVAL = 0.05;
16 
17  float m_InitWaitTime; //After this time after deployment, the trap is activated
18  bool m_NeedActivation; //If activation of trap is needed
19  float m_DefectRate; //Added damage after trap activation
20  float m_DamagePlayers; //How much damage player gets when caught
21  float m_DamageOthers; //How much damage player gets when caught
22 
23  bool m_AddActivationDefect; // Damage trap after activation
24  bool m_AddDeactivationDefect; // Damage trap after deactivation
25  protected bool m_IsActive; // True means that the trap is ready to detonate
26  protected bool m_IsInProgress;
27 
28  protected bool m_Disarmed = false;
29 
31 
35 
36  string m_InfoSetup;
39  string m_InfoDamage;
41 
42  protected ref Timer m_Timer;
43  protected ref Timer m_UpdateTimer;
45 
46  protected ref array<int> m_ClothingDmg;
47  protected ref EffectSound m_DeployLoopSound; //DEPRECATED in favor of m_DeployLoopSoundEx
48 
49  void TrapBase()
50  {
51  m_IsInProgress = false;
52  m_NeedActivation = true;
53  m_InitWaitTime = 5; //After this time after deployment, the trap is activated
54  m_DefectRate = 15; //Added damage after trap activation
55  m_DamagePlayers = 25; //How much damage player gets when caught
56  m_DamageOthers = 100; //How much damage others gets when caught
57 
58  m_AddActivationDefect = false;
60 
62 
66 
67  m_InfoSetup = "#STR_TrapBase0";
68  m_InfoDeactivated = "#STR_TrapBase1";
69  m_InfoDamageManipulation = "#STR_TrapBase2";
70  m_InfoDamage = "#STR_TrapBase3";
71  m_InfoActivationTime = "#STR_TrapBase4" + m_InitWaitTime.ToString() + "#STR_TrapBase5";
72 
73  m_UpdateTimer = new ref Timer();
74 
75  RegisterNetSyncVariableBool("m_IsActive");
76  RegisterNetSyncVariableBool("m_IsInProgress");
77  RegisterNetSyncVariableBool("m_IsSoundSynchRemote");
78  RegisterNetSyncVariableBool("m_IsDeploySound");
79  }
80 
81  void ~TrapBase()
82  {
83  SEffectManager.DestroyEffect( m_DeployLoopSound );
84  }
85 
86  void OnUpdate(EntityAI victim);
87 
89  {
90  return m_TrapTrigger;
91  }
92 
94  override void OnVariablesSynchronized()
95  {
96  super.OnVariablesSynchronized();
97 
98  if (IsDeploySound())
100 
103 
106 
107  if (GetGame().IsMultiplayer())
108  {
109  if (m_IsActive && !m_IsInProgress)
110  SetActive();
111 
112  if (m_IsInProgress && !m_IsActive)
113  StartActivate(null);
114  }
115  }
116 
117  override void EEDelete(EntityAI parent)
118  {
119  super.EEDelete(parent);
120 
121  if (GetGame() && m_TrapTrigger)
122  {
123  GetGame().ObjectDelete(m_TrapTrigger);
124  m_TrapTrigger = null;
125  }
126  }
127 
128  override void OnStoreSave(ParamsWriteContext ctx)
129  {
130  super.OnStoreSave(ctx);
131 
132  ctx.Write(m_IsActive);
133  ctx.Write(m_IsInProgress);
134  }
135 
136  //----------------------------------------------------------------
137  override bool OnStoreLoad(ParamsReadContext ctx, int version)
138  {
139  if ( !super.OnStoreLoad(ctx, version) )
140  return false;
141 
142  bool b_is_active = false;
143  if ( !ctx.Read( b_is_active ) )
144  b_is_active = false;
145 
146  bool b_is_in_progress = false;
147  if ( !ctx.Read( b_is_in_progress ) )
148  b_is_in_progress = false;
149 
150  if ( b_is_active )
151  {
152  SetActive();
153  }
154 
155  if (b_is_in_progress && !b_is_active)
156  {
157  StartActivate(null);
158  }
159 
160  return true;
161  }
162 
163  bool IsActive()
164  {
165  return m_IsActive && m_IsInProgress == false && GetHierarchyRootPlayer() == null;
166  }
167 
168  bool IsInactive()
169  {
170  return !IsActive() && m_IsInProgress == false && GetHierarchyRootPlayer() == null;
171  }
172 
173  // trap cannot be taken when is activated
174  override bool IsTakeable()
175  {
176  if ( m_IsInProgress == false && !IsActive() )
177  {
178  return true;
179  }
180 
181  return false;
182  }
183 
184  bool IsActivable()
185  {
186  return !IsActive() && GetHierarchyRootPlayer() == null && GetHierarchyParent() == null && m_IsInProgress == false && !IsRuined() && m_NeedActivation;
187  }
188 
189  bool IsPlaceable()
190  {
191  if ( GetHierarchyRootPlayer() != null && GetHierarchyRootPlayer().GetHumanInventory().GetEntityInHands() == this )
192  {
193  PlayerBase player = PlayerBase.Cast( GetHierarchyRootPlayer() );
194 
195  vector player_pos = player.GetPosition();
196  vector aim_pos = player.GetAimPosition();
197 
198  if ( vector.DistanceSq( player_pos, aim_pos ) <= ( Math.SqrFloat( 1.5 ) ) )
199  {
200  return IsPlaceableAtPosition( aim_pos );
201  }
202  }
203 
204  return false;
205  }
206 
207  bool IsPlaceableAtPosition( vector position )
208  {
209  if ( GetGame().SurfaceIsSea( position[0], position[2] ) )
210  {
211  return false;
212  }
213  else if ( GetGame().SurfaceIsPond( position[0], position[2] ) )
214  {
215  return false;
216  }
217 
218  return true;
219  }
220 
221  void Disarm()
222  {
223  SetInactive(false);
224  RefreshState();
225  GetGame().RPCSingleParam(this, ERPCs.RPC_TRAP_DISARM, null, true);
226 
227  OnDisarm();
228  }
229 
231  void OnDisarm();
232 
233  void SnapOnObject(EntityAI victim)
234  {
235  if ( GetGame().IsServer() )
236  {
237  if ( m_Timer )
238  {
239  m_Timer.Stop();
240  }
241 
242  RefreshState();
243 
244  if (m_DamagePlayers > 0)
245  {
246  if (victim)
247  {
248  if ( victim.IsInherited(SurvivorBase))
249  {
250  victim.DecreaseHealth("", "", m_DamagePlayers);
251  }
252  else if (victim.IsInherited(DayZCreatureAI))
253  {
254  victim.DecreaseHealth("", "", m_DamageOthers);
255  }
256  else if (victim.IsInherited(ItemBase))
257  {
258  ItemBase victim_item = ItemBase.Cast(victim);
259  float damage_coef = 1;
260 
261  if (victim_item.HasQuantity() && victim_item.GetQuantityMax() != 0 && victim_item.GetQuantity() > 0)
262  {
263  damage_coef = victim_item.GetQuantityMax() / victim_item.GetQuantity(); // Lower quantity increases damage exposure
264  }
265 
266  if (damage_coef > 0)
267  {
268  int item_size_x = 1;
269  int item_size_y = 1;
270  GetGame().GetInventoryItemSize(victim_item, item_size_x, item_size_y);
271 
272  float add_damage = 300 * damage_coef / Math.Clamp(item_size_x * item_size_y, 1, int.MAX);
273  victim_item.DecreaseHealth("", "", add_damage);
274  }
275  }
276  }
277  }
278 
279  Synch(victim);
280  }
281 
282  OnSteppedOn(victim);
283  }
284 
286  {
287  OnSteppedOut(victim);
288  }
289 
290  void OnSteppedOn(EntityAI victim)
291  {
292  SetInactive(false);
293  }
294 
295  void OnSteppedOut(EntityAI victim);
296 
297  // Synchronizes states
298  protected void Synch(EntityAI victim)
299  {
300  if (GetGame().IsServer())
301  {
302  if (victim && !victim.GetAllowDamage())
303  return;
304 
305  Param1<EntityAI> p = new Param1<EntityAI>(victim);
306  GetGame().RPCSingleParam(this, ERPCs.RPC_TRAP_VICTIM, p, true);
307  }
308 
309  }
310 
311  // On server -> client synchronization
312  override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
313  {
314  super.OnRPC(sender, rpc_type, ctx);
315 
316  if ( !GetGame().IsDedicatedServer() )
317  {
318  switch (rpc_type)
319  {
320  case ERPCs.RPC_TRAP_VICTIM:
321  Param1<EntityAI> victim = new Param1<EntityAI>(null);
322 
323  if (ctx.Read(victim))
324  {
325  if (victim.param1)
326  SnapOnObject(victim.param1);
327  }
328 
329  break;
330 
331  case ERPCs.RPC_TRAP_DISARM:
332  OnDisarm();
333  break;
334 
335  case SoundTypeTrap.ACTIVATING:
336 
337  Param1<bool> p = new Param1<bool>(false);
338 
339  bool isActivating = false;
340  if (ctx.Read(p))
341  isActivating = p.param1;
342 
343  if (isActivating)
345 
346  if (!isActivating)
348 
349  break;
350  }
351  }
352  }
353 
355  {
357  {
358  return;
359  }
360 
361  if ( GetGame().IsServer() )
362  {
363  // item is owned by player
364  if ( GetHierarchyRootPlayer() != NULL && m_AnimationPhaseGrounded != "" )
365  {
366  SetAnimationPhase( m_AnimationPhaseSet, 1 );
368  {
369  SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
370  }
371  SetAnimationPhase( m_AnimationPhaseGrounded, 0 );
372  }
373  // item is set active
374  else if ( IsActive() )
375  {
376  if ( m_AnimationPhaseGrounded != "" )
377  {
378  SetAnimationPhase( m_AnimationPhaseGrounded, 1 );
379  }
380  if ( m_AnimationPhaseSet != "" && m_AnimationPhaseTriggered != "" )
381  {
382  SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
383  SetAnimationPhase( m_AnimationPhaseSet, 0 );
384  }
385  }
386  // item is inactive and not owned by player (on the ground)
387  else if ( IsInactive() )
388  {
390  {
391  SetAnimationPhase( m_AnimationPhaseGrounded, 1 );
392  }
393  if ( m_AnimationPhaseSet != "" && m_AnimationPhaseTriggered != "" )
394  {
395  SetAnimationPhase( m_AnimationPhaseSet, 1 );
396  SetAnimationPhase( m_AnimationPhaseTriggered, 0 );
397  }
398  }
399  }
400  }
401 
402  void SetupTrap()
403  {
404  if (GetGame().IsServer())
405  {
406  if (GetHierarchyRootPlayer() && GetHierarchyRootPlayer().CanDropEntity(this))
407  SetupTrapPlayer(PlayerBase.Cast(GetHierarchyRootPlayer()));
408  }
409  }
410 
411  void SetupTrapPlayer( PlayerBase player, bool set_position = true )
412  {
413  if (GetGame().IsServer())
414  {
415  if (set_position)
416  {
417  player.LocalDropEntity(this);
418 
419  vector trapPos = player.GetDirection() * 1.5;
420  trapPos[1] = 0;
421  SetPosition(player.GetPosition() + trapPos);
422  }
423 
424  if (m_NeedActivation == false)
425  SetActive();
426  }
427  }
428 
429  void AddDefect()
430  {
431  if ( GetGame().IsServer() )
432  {
433  DecreaseHealth( "", "", m_DefectRate );
434  }
435  }
436 
437  void SetActive()
438  {
440 
441  m_IsInProgress = false;
442  m_IsActive = true;
443 
445  {
446  AddDefect();
447  }
448 
449  if (GetGame().IsServer())
450  {
451  CreateTrigger();
452  RefreshState();
453  SetSynchDirty();
454  }
455 
456  OnActivate();
457  }
458 
459  void OnActivate();
460 
462  {
463  if (GetGame().IsServer())
464  {
466  HideSelection("safety_pin");
467 
468  if (m_InitWaitTime > 0)
469  {
470  m_IsInProgress = true;
471  m_Timer.Run(m_InitWaitTime, this, "SetActive");
472 
473  SetSynchDirty();
474  }
475  else
476  SetActive();
477  }
478  }
479 
480  void StartDeactivate(PlayerBase player);
481 
482  void SetInactive(bool stop_timer = true)
483  {
485 
486  m_IsActive = false;
487  if (m_Timer && stop_timer)
488  m_Timer.Stop();
489 
491  AddDefect();
492 
493  SetSynchDirty();
494  DeleteTrigger();
495  RefreshState();
496  }
497 
498  void CreateTrigger()
499  {
500  if (Class.CastTo(m_TrapTrigger, GetGame().CreateObjectEx("TrapTrigger", GetPosition(), SPAWN_FLAGS)))
501  {
502  vector mins = "-0.01 -0.05 -0.01";
503  vector maxs = "0.01 0.5 0.01";
504  m_TrapTrigger.SetOrientation(GetOrientation());
505  m_TrapTrigger.SetExtents(mins, maxs);
506  m_TrapTrigger.SetParentObject(this);
507  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(DeferredEnableTrigger);
508  }
509  }
510 
512  {
513  if (m_TrapTrigger)
514  {
515  m_TrapTrigger.SetParentObject(null);
516  m_TrapTrigger.DeleteSafe();
517  }
518  }
519 
521  {
522  if (m_TrapTrigger)
523  m_TrapTrigger.SetEnabled();
524  }
525 
526  override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
527  {
528  super.OnItemLocationChanged(old_owner, new_owner);
529 
530  if (GetGame().IsServer())
531  {
532  RefreshState();
533 
534  // TAKE ACTIVE TRAP FROM VICINITY
535  if (old_owner == NULL && new_owner != NULL && IsActive())
536  {
537  // TAKE INTO HANDS
538  if ( new_owner.IsPlayer() )
539  {
540  SnapOnObject(new_owner);
541  }
542  else if (new_owner.GetHierarchyRootPlayer())
543  {
544  SnapOnObject(new_owner.GetHierarchyRootPlayer());
545  }
546  }
547  }
548 
549  }
550 
551  override void EEItemAttached(EntityAI item, string slot_name)
552  {
553  super.EEItemAttached(item, slot_name);
554 
555  if (GetGame().IsServer())
556  RefreshState();
557  }
558 
559  override void EEItemDetached(EntityAI item, string slot_name)
560  {
561  super.EEItemDetached(item, slot_name);
562 
563  if (GetGame().IsServer())
564  RefreshState();
565  }
566 
567  override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
568  {
569  super.OnPlacementComplete(player, position, orientation);
570 
571  if (GetGame().IsServer())
572  {
573  SetOrientation(orientation);
574  SetPosition(position);
575  PlaceOnSurface();
576  SetSynchDirty();
577  }
578  }
579 
580  override bool CanPutInCargo( EntityAI parent )
581  {
582  if ( !super.CanPutInCargo(parent) )
583  {
584  return false;
585  }
586 
587  return IsTakeable();
588  }
589 
590  override bool CanPutIntoHands( EntityAI parent )
591  {
592  if ( !super.CanPutIntoHands( parent ) )
593  {
594  return false;
595  }
596 
597  return IsTakeable();
598  }
599 
600  override bool CanRemoveFromHands( EntityAI parent )
601  {
602  return IsTakeable();
603  }
604 
605  override bool CanBePlaced( Man player, vector position )
606  {
607  return IsPlaceableAtPosition( position );
608  }
609 
612  {
613  return true;
614  }
615 
616  //Set if trap can be disarmed using trap-specific action
617  bool CanBeDisarmed()
618  {
619  return false;
620  }
621 
623  void SetDisarmed( bool disarmed )
624  {
625  m_Disarmed = disarmed;
626  }
627 
629  bool GetDisarmed()
630  {
631  return m_Disarmed;
632  }
633 
634  //================================================================
635  // ADVANCED PLACEMENT
636  //================================================================
637 
638  void PlayDeployLoopSound(); //deprecated
639 
640  void StopDeployLoopSound(); //deprecated
641 
642  override void SetActions()
643  {
644  super.SetActions();
645 
647  }
648 
649  // HELPERS
651  {
653  vector trapPosXZ = GetPosition();
654  trapPosXZ[1] = 0;
655 
656  GameInventory inv = victim.GetInventory();
657  for (int i = 0; i < inv.AttachmentCount(); i++)
658  {
660  EntityAI wheelEntity = inv.GetAttachmentFromIndex(i);
661  if (wheelEntity && wheelEntity.Type() == CarWheel_Ruined)
662  {
663  continue;
664  }
665 
667  int slotId;
668  string slotName;
669  wheelEntity.GetInventory().GetCurrentAttachmentSlotInfo(slotId, slotName);
670  slotName.ToLower();
671  if (slotName.Contains("spare"))
672  {
673  continue
674  }
675 
677  if (wheelEntity && wheelEntity.IsInherited(CarWheel))
678  {
679  vector entPosXZ = wheelEntity.GetPosition();
680  entPosXZ[1] = 0;
681  if (vector.Distance(trapPosXZ, entPosXZ) < 1)
682  {
683  return wheelEntity;
684  }
685  }
686  }
687 
688  return null;
689  }
690 
691  protected void DamageClothing(PlayerBase player)
692  {
693  //Array used to find all relevant information about currently equipped clothes
694  array<ClothingBase> equippedClothes = new array<ClothingBase>;
695 
696  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("LEGS")));
697  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BACK")));
698  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("VEST")));
699  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("HeadGear")));
700  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("Mask")));
701  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BODY")));
702  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("FEET")));
703  equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("GLOVES")));
704 
705  //Damage all currently equipped clothes
706  for (int i = 0; i < equippedClothes.Count(); i++)
707  {
708  //If no item is equipped on slot, slot is ignored
709  if (equippedClothes[i] == null)
710  {
711  continue;
712  }
713 
714  equippedClothes[i].DecreaseHealth(m_ClothingDmg[i], false);
715  }
716  }
717 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
GetDisarmed
bool GetDisarmed()
DEPRECATED.
Definition: trapbase.c:629
OnVariablesSynchronized
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
Definition: trapbase.c:94
m_ClothingDmg
protected ref array< int > m_ClothingDmg
Definition: trapbase.c:46
m_AddDeactivationDefect
bool m_AddDeactivationDefect
Definition: trapbase.c:24
CarWheel_Ruined
Definition: inventoryitem.c:309
OnRPC
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Definition: trapbase.c:312
m_InfoDamage
string m_InfoDamage
Definition: trapbase.c:39
m_InfoDeactivated
string m_InfoDeactivated
Definition: trapbase.c:37
DeleteTrigger
void DeleteTrigger()
Definition: trapbase.c:511
m_UpdateTimer
protected ref Timer m_UpdateTimer
Definition: trapbase.c:43
StartActivate
void StartActivate(PlayerBase player)
Definition: trapbase.c:461
Disarm
void Disarm()
Definition: trapbase.c:221
m_IsInProgress
protected bool m_IsInProgress
Definition: trapbase.c:26
m_InfoSetup
string m_InfoSetup
Definition: trapbase.c:36
OnStoreSave
override void OnStoreSave(ParamsWriteContext ctx)
Definition: trapbase.c:128
m_Disarmed
protected bool m_Disarmed
Definition: trapbase.c:28
SnapOnObject
void SnapOnObject(EntityAI victim)
Definition: trapbase.c:233
ClothingBase
Definition: dallasmask.c:1
m_DamageOthers
float m_DamageOthers
Definition: trapbase.c:21
IsPlaceableAtPosition
bool IsPlaceableAtPosition(vector position)
Definition: trapbase.c:207
DAMAGE_TRIGGER_MINE
const protected int DAMAGE_TRIGGER_MINE
Definition: trapbase.c:14
SetActive
void SetActive()
Definition: trapbase.c:437
m_TrapTrigger
protected TrapTrigger m_TrapTrigger
Definition: trapbase.c:44
ActionActivateTrap
ActionActivateTrapCB ActionContinuousBaseCB ActionActivateTrap()
Definition: actionactivatetrap.c:18
m_WasActivatedOrDeactivated
bool m_WasActivatedOrDeactivated
DEPRECATED Used for explosive traps to prevent detonation after destroying through disarm action.
Definition: trapbase.c:30
PlayDeploySound
void PlayDeploySound()
Definition: itembase.c:4324
ACTIVATING
@ ACTIVATING
Definition: trapbase.c:3
m_IsActive
protected bool m_IsActive
Definition: trapbase.c:25
OnStoreLoad
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition: trapbase.c:137
DayZCreatureAI
do not process rotations !
Definition: dayzanimal.c:606
SetupTrap
void SetupTrap()
Definition: trapbase.c:402
DeferredEnableTrigger
void DeferredEnableTrigger()
Definition: trapbase.c:520
PlayDeployLoopSound
void PlayDeployLoopSound()
DamageClothing
protected void DamageClothing(PlayerBase player)
Definition: trapbase.c:691
EEItemDetached
override void EEItemDetached(EntityAI item, string slot_name)
Definition: trapbase.c:559
IsActive
bool IsActive()
Definition: trapbase.c:163
m_AnimationPhaseSet
string m_AnimationPhaseSet
Definition: trapbase.c:33
m_DamagePlayers
float m_DamagePlayers
Definition: trapbase.c:20
SPAWN_FLAGS
enum SoundTypeTrap SPAWN_FLAGS
IsDeploySound
bool IsDeploySound()
Definition: itembase.c:4298
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
PlayerIdentity
The class that will be instanced (moddable)
Definition: gameplay.c:377
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
UPDATE_TIMER_INTERVAL
const protected float UPDATE_TIMER_INTERVAL
Definition: trapbase.c:15
PlayerBase
Definition: playerbaseclient.c:1
vector
Definition: enconvert.c:105
GetClosestCarWheel
protected EntityAI GetClosestCarWheel(EntityAI victim)
Definition: trapbase.c:650
IsInactive
bool IsInactive()
Definition: trapbase.c:168
CanPutInCargo
override bool CanPutInCargo(EntityAI parent)
Definition: trapbase.c:580
OnItemLocationChanged
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition: trapbase.c:526
CanPutIntoHands
override bool CanPutIntoHands(EntityAI parent)
Definition: trapbase.c:590
IsTakeable
override bool IsTakeable()
Definition: trapbase.c:174
IsActivable
bool IsActivable()
Definition: trapbase.c:184
SetInactive
void SetInactive(bool stop_timer=true)
Definition: trapbase.c:482
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
CarWheel
Definition: inventoryitem.c:413
CanBePlaced
override bool CanBePlaced(Man player, vector position)
Definition: trapbase.c:605
slotName
PlayerSpawnPreset slotName
TrapTrigger
Trigger used by traps.
Definition: traptrigger.c:2
IsPlaceable
bool IsPlaceable()
Definition: trapbase.c:189
m_Timer
protected ref Timer m_Timer
Definition: trapbase.c:42
GetTrapTrigger
TrapTrigger GetTrapTrigger()
Definition: trapbase.c:88
m_AnimationPhaseGrounded
string m_AnimationPhaseGrounded
Definition: trapbase.c:32
SetDisarmed
void SetDisarmed(bool disarmed)
DEPRECATED.
Definition: trapbase.c:623
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
CanBeClapped
bool CanBeClapped()
DEPRECATED Set if trap can be disarmed using ActionClapBearTrapWithThisItem.
Definition: trapbase.c:611
RemoveFromObject
void RemoveFromObject(EntityAI victim)
Definition: trapbase.c:285
RefreshState
void RefreshState()
Definition: trapbase.c:354
m_DeployLoopSound
protected ref EffectSound m_DeployLoopSound
Definition: trapbase.c:47
SetPosition
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition: effect.c:436
Synch
protected void Synch(EntityAI victim)
keeping "step" here for consistency only
Definition: trapbase.c:298
StopDeployLoopSound
void StopDeployLoopSound()
~TrapBase
void ~TrapBase()
Definition: trapbase.c:81
EEItemAttached
override void EEItemAttached(EntityAI item, string slot_name)
Definition: trapbase.c:551
m_InfoActivationTime
string m_InfoActivationTime
Definition: trapbase.c:40
AddDefect
void AddDefect()
Definition: trapbase.c:429
CanRemoveFromHands
override bool CanRemoveFromHands(EntityAI parent)
Definition: trapbase.c:600
CanPlayDeployLoopSound
bool CanPlayDeployLoopSound()
Definition: itembase.c:4360
TrapBase
void TrapBase()
Definition: trapbase.c:49
SoundTypeTrap
SoundTypeTrap
Definition: trapbase.c:1
ERPCs
ERPCs
Definition: erpcs.c:1
m_InfoDamageManipulation
string m_InfoDamageManipulation
Definition: trapbase.c:38
Timer
Definition: dayzplayerimplement.c:62
ECE_CREATEPHYSICS
const int ECE_CREATEPHYSICS
Definition: centraleconomy.c:16
ECE_LOCAL
const int ECE_LOCAL
Definition: centraleconomy.c:24
EEDelete
override void EEDelete(EntityAI parent)
Definition: trapbase.c:117
m_NeedActivation
bool m_NeedActivation
Definition: trapbase.c:18
Math
Definition: enmath.c:6
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_DefectRate
float m_DefectRate
Definition: trapbase.c:19
m_AnimationPhaseTriggered
string m_AnimationPhaseTriggered
Definition: trapbase.c:34
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
m_InitWaitTime
float m_InitWaitTime
Definition: trapbase.c:17
SetupTrapPlayer
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Definition: trapbase.c:411
MAX
const int MAX
Definition: enconvert.c:27
EntityAI
Definition: building.c:5
StartDeactivate
void StartDeactivate(PlayerBase player)
Definition: trap_tripwire.c:218
TrapBase
Definition: trap_bear.c:1
GameInventory
script counterpart to engine's class Inventory
Definition: inventory.c:78
m_AddActivationDefect
bool m_AddActivationDefect
Definition: trapbase.c:23
GetOrientation
vector GetOrientation()
Definition: areadamagemanager.c:306