Dayz  1.11.153731
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  int m_InitWaitTime; //After this time after deployment, the trap is activated
9  bool m_NeedActivation; //If activation of trap is needed
10  float m_DefectRate; //Added damage after trap activation
11  float m_DamagePlayers; //How much damage player gets when caught
12  float m_DamageOthers; //How much damage player gets when caught
13 
14  bool m_AddActivationDefect; // Damage trap after activation
15  bool m_AddDeactivationDefect; // Damage trap after deactivation
16  protected bool m_IsActive; // True means that the trap is ready to detonate
17  protected bool m_IsInProgress;
18 
20 
24 
25  string m_InfoSetup;
28  string m_InfoDamage;
30 
31  protected ref Timer m_Timer;
32  protected TrapTrigger m_TrapTrigger;
33 
35 
36  void TrapBase()
37  {
38  m_IsInProgress = false;
39  m_NeedActivation = true;
40  m_InitWaitTime = 5; //After this time after deployment, the trap is activated
41  m_DefectRate = 15; //Added damage after trap activation
42  m_DamagePlayers = 25; //How much damage player gets when caught
43  m_DamageOthers = 100; //How much damage player gets when caught
44 
45  m_AddActivationDefect = false;
47 
49 
53 
54  m_InfoSetup = "#STR_TrapBase0";
55  m_InfoDeactivated = "#STR_TrapBase1";
56  m_InfoDamageManipulation = "#STR_TrapBase2";
57  m_InfoDamage = "#STR_TrapBase3";
58  m_InfoActivationTime = "#STR_TrapBase4" + m_InitWaitTime.ToString() + "#STR_TrapBase5";
59 
61 
62  RegisterNetSyncVariableBool("m_IsActive");
63  RegisterNetSyncVariableBool("m_IsInProgress");
64  RegisterNetSyncVariableBool("m_IsSoundSynchRemote");
65  RegisterNetSyncVariableBool("m_IsDeploySound");
66  }
67 
68  void ~TrapBase()
69  {
70  if ( m_DeployLoopSound )
71  {
73  }
74  }
75 
77  override void OnVariablesSynchronized()
78  {
79  super.OnVariablesSynchronized();
80 
81  if ( IsDeploySound() )
82  {
84  }
85 
86  if ( CanPlayDeployLoopSound() )
87  {
89  }
90 
92  {
94  }
95 
96  if ( GetGame().IsMultiplayer() )
97  {
98  if ( m_IsActive )
99  {
100  SetActive();
101  }
102 
103  if (m_IsInProgress && !m_IsActive)
104  {
105  StartActivate( NULL );
106  }
107  }
108  }
109 
110  override void EEDelete(EntityAI parent)
111  {
112  super.EEDelete(parent);
113 
114  //GetGame() can be sometimes NULL when turning off server
115  if ( GetGame() && m_TrapTrigger )
116  {
118  m_TrapTrigger = NULL;
119  }
120  }
121 
122  override void OnStoreSave(ParamsWriteContext ctx)
123  {
124  super.OnStoreSave(ctx);
125 
126  ctx.Write( m_IsActive );
127 
128  ctx.Write( m_IsInProgress );
129  }
130 
131  //----------------------------------------------------------------
132  override bool OnStoreLoad(ParamsReadContext ctx, int version)
133  {
134  if ( !super.OnStoreLoad(ctx, version) )
135  return false;
136 
137  bool b_is_active = false;
138  if ( !ctx.Read( b_is_active ) )
139  b_is_active = false;
140 
141  bool b_is_in_progress = false;
142  if ( !ctx.Read( b_is_in_progress ) )
143  b_is_in_progress = false;
144 
145  if ( b_is_active )
146  {
147  SetActive();
148  }
149 
150  if (b_is_in_progress && !b_is_active)
151  {
152  StartActivate( NULL );
153  }
154 
155  return true;
156  }
157 
158  bool IsActive()
159  {
160  if ( m_IsActive && m_IsInProgress == false && this.GetHierarchyRootPlayer() == NULL )
161  {
162  return true;
163  }
164  return false;
165  }
166 
167  bool IsInactive()
168  {
169  if ( m_IsActive == false && m_IsInProgress == false && this.GetHierarchyRootPlayer() == NULL )
170  {
171  return true;
172  }
173  return false;
174  }
175 
176  // trap cannot be taken when is activated
177  override bool IsTakeable()
178  {
179  if ( m_IsInProgress == false && !IsActive() )
180  {
181  return true;
182  }
183 
184  return false;
185  }
186 
187  bool IsActivable()
188  {
189  if ( m_IsActive == false && this.GetHierarchyRootPlayer() == NULL && this.GetHierarchyParent() == NULL && m_IsInProgress == false && !this.IsRuined() && m_NeedActivation )
190  {
191  return true;
192  }
193 
194  return false;
195  }
196 
197  bool IsPlaceable()
198  {
199  if ( this.GetHierarchyRootPlayer() != NULL && this.GetHierarchyRootPlayer().GetHumanInventory().GetEntityInHands() == this )
200  {
201  PlayerBase player = PlayerBase.Cast( this.GetHierarchyRootPlayer() );
202 
203  vector player_pos = player.GetPosition();
204  vector aim_pos = player.GetAimPosition();
205 
206  if ( vector.Distance(player_pos, aim_pos) <= 1.5 )
207  {
208  return IsPlaceableAtPosition( aim_pos );
209  }
210  }
211 
212  return false;
213  }
214 
215  bool IsPlaceableAtPosition( vector position )
216  {
217  if( GetGame().SurfaceIsSea( position[0], position[2] ) )
218  {
219  return false;
220  }
221  else if( GetGame().SurfaceIsPond( position[0], position[2] ) )
222  {
223  return false;
224  }
225 
226  return true;
227  }
228 
229  void SnapOnObject( EntityAI victim )
230  {
231  if ( g_Game.IsServer() )
232  {
233  if ( m_Timer )
234  {
235  m_Timer.Stop();
236  }
237 
238  this.RefreshState();
239 
240  if (m_DamagePlayers > 0)
241  {
242  if (victim)
243  {
244  if ( victim.IsInherited(SurvivorBase) )
245  {
246  victim.DecreaseHealth( "", "", m_DamagePlayers );
247  //PlayerBase player = PlayerBase.Cast( victim );
248  //player.MessageStatus( m_InfoDamage );
249  }
250  else if(victim.IsInherited(DayZCreatureAI) )
251  {
252  victim.DecreaseHealth( "", "", m_DamageOthers );
253  }
254  else if(victim.IsInherited(ItemBase) )
255  {
256  ItemBase victim_item = ItemBase.Cast( victim );
257  float damage_coef = 1;
258 
259  if ( victim_item.HasQuantity() && victim_item.GetQuantityMax() != 0 )
260  {
261  damage_coef = victim_item.GetQuantityMax() / victim_item.GetQuantity(); // Lower quantity increases damage exposure
262  }
263 
264  if (damage_coef > 0)
265  {
266  int item_size_x = 1;
267  int item_size_y = 1;
268 
269  GetGame().GetInventoryItemSize(victim_item, item_size_x, item_size_y);
270 
271  int item_size = item_size_x * item_size_y;
272 
273  if (item_size == 0)
274  item_size = 1;
275 
276  float add_damage = 300*damage_coef/item_size;
277  victim_item.DecreaseHealth( "", "", add_damage );
278  }
279  }
280  }
281  }
282 
283  SetInactive( false );
284  AddDefect();
285  }
286 
287  OnSteppedOn(victim);
288  Synch(victim);
289  }
290 
291  void OnSteppedOn(EntityAI victim)
292  {
293 
294  }
295 
296  // Synchronizes states
297  protected void Synch(EntityAI victim)
298  {
299  if ( GetGame().IsServer() )
300  {
301  SetSynchDirty();
302 
303  Param1<EntityAI> p = new Param1<EntityAI>( victim );
304  GetGame().RPCSingleParam( this, ERPCs.RPC_TRAP_VICTIM, p, true );
305  }
306 
307  }
308 
309  // On server -> client synchronization
310  override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
311  {
312  super.OnRPC(sender, rpc_type, ctx);
313 
314  if ( GetGame().IsClient() || !GetGame().IsMultiplayer() )
315  {
316  switch(rpc_type)
317  {
318  case ERPCs.RPC_TRAP_VICTIM:
319 
320  ref Param1<EntityAI> p_victim = new Param1<EntityAI>(NULL);
321 
322  if (ctx.Read(p_victim))
323  {
324  if (p_victim.param1)
325  {
326  SnapOnObject(p_victim.param1);
327  }
328  }
329 
330  break;
331 
332  case SoundTypeTrap.ACTIVATING:
333 
334  ref Param1<bool> p = new Param1<bool>(false);
335 
336  if (ctx.Read(p))
337  {
338  bool play = p.param1;
339  }
340 
341  if ( play )
342  {
344  }
345 
346  if ( !play )
347  {
349  }
350 
351  break;
352  }
353  }
354  }
355 
357  {
359  {
360  return;
361  }
362 
363  if ( g_Game.IsServer() )
364  {
365  // item is owned by player
366  if ( this.GetHierarchyRootPlayer() != NULL && m_AnimationPhaseGrounded != "" )
367  {
368  this.SetAnimationPhase( m_AnimationPhaseSet, 1 );
370  {
371  this.SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
372  }
373  this.SetAnimationPhase( m_AnimationPhaseGrounded, 0 );
374  }
375  // item is set active
376  else if ( this.IsActive() )
377  {
378  if ( m_AnimationPhaseGrounded != "" )
379  {
380  this.SetAnimationPhase( m_AnimationPhaseGrounded, 1 );
381  }
382  if ( m_AnimationPhaseSet != "" && m_AnimationPhaseTriggered != "" )
383  {
384  this.SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
385  this.SetAnimationPhase( m_AnimationPhaseSet, 0 );
386  }
387  }
388  // item is inactive and not owned by player (on the ground)
389  else if ( this.IsInactive() )
390  {
391  if ( m_AnimationPhaseGrounded != "" && m_AnimationPhaseTriggered != m_AnimationPhaseGrounded )
392  {
393  this.SetAnimationPhase( m_AnimationPhaseGrounded, 1 );
394  }
395  if ( m_AnimationPhaseSet != "" && m_AnimationPhaseTriggered != "" )
396  {
397  this.SetAnimationPhase( m_AnimationPhaseSet, 1 );
398  this.SetAnimationPhase( m_AnimationPhaseTriggered, 0 );
399  }
400  }
401  }
402  }
403 
404  void SetupTrap()
405  {
406  if ( GetGame().IsServer() )
407  {
408  if ( this.GetHierarchyRootPlayer() && this.GetHierarchyRootPlayer().CanDropEntity( this) ) // kvoli desyncu
409  {
410  SetupTrapPlayer( PlayerBase.Cast( this.GetHierarchyRootPlayer() ) );
411  }
412  }
413  }
414 
415  void SetupTrapPlayer( PlayerBase player, bool set_position = true )
416  {
417  if ( GetGame().IsServer() )
418  {
419  if ( set_position )
420  {
421  Error("Mojmir: TODO");
422  player.LocalDropEntity( this );
423 
424  vector trapPos = ( player.GetDirection() ) * 1.5;
425  trapPos[1] = 0;
426  this.SetPosition( player.GetPosition() + trapPos );
427  }
428 
429  if ( m_NeedActivation == false )
430  {
431  this.SetActive();
432  }
433  //player.MessageStatus( m_InfoSetup );
434  }
435  }
436 
437  void AddDefect()
438  {
439  if ( g_Game.IsServer() )
440  {
441  this.DecreaseHealth( "", "", m_DefectRate );
442  }
443  }
444 
445  void SetActive()
446  {
448 
449  m_IsInProgress = false;
450  m_IsActive = true;
451 
452  if ( m_AddActivationDefect )
453  {
454  this.AddDefect();
455  }
456 
457  if ( g_Game.IsServer() )
458  {
459  RefreshState();
460  CreateTrigger();
461  Synch(NULL);
462  }
463 
464  OnActivate();
465  }
466 
467  void OnActivate()
468  {
469 
470  }
471 
472  void StartActivate( PlayerBase player )
473  {
474  if ( GetGame().IsServer() || !GetGame().IsMultiplayer() )
475  {
476  m_Timer = new Timer( CALL_CATEGORY_SYSTEM );
477  HideSelection("safety_pin");
478 
479  if ( m_InitWaitTime > 0 )
480  {
481  m_IsInProgress = true;
482  m_Timer.Run( m_InitWaitTime, this, "SetActive" );
483 
484  Synch(NULL);
485  }
486  else
487  {
488  SetActive();
489  }
490  }
491  }
492 
494  {
495  if ( g_Game.IsServer() )
496  {
497  //player.MessageStatus( m_InfoDeactivated );
498  this.SetInactive();
499  }
500  }
501 
502  void SetInactive( bool stop_timer = true )
503  {
505 
506  m_IsActive = false;
507  if ( m_Timer && stop_timer )
508  {
509  m_Timer.Stop();
510  }
511  Print("Delete trap trigger");
513  g_Game.ObjectDelete( m_TrapTrigger );
514  m_TrapTrigger = NULL;
515 
517  {
518  this.AddDefect();
519  }
520 
521  // de-attach attachments
522  int attachments = GetInventory().AttachmentCount();
523  if ( attachments > 0 )
524  {
525  EntityAI attachment = GetInventory().GetAttachmentFromIndex(0);
526  if (attachment)
527  {
528  Error("Mojmir: TODO");
529  this.LocalDropEntity( attachment );
530  }
531  }
532 
533  this.RefreshState();
534  Synch(NULL);
535  }
536 
538  {
539  m_TrapTrigger = TrapTrigger.Cast( g_Game.CreateObject( "TrapTrigger", this.GetPosition(), false ) );
540  vector mins = "-0.01 -0.05 -0.01";
541  vector maxs = "0.01 0.05 0.01";
542  m_TrapTrigger.SetOrientation( this.GetOrientation() );
543  m_TrapTrigger.SetExtents(mins, maxs);
544  m_TrapTrigger.SetParentObject( this );
545  }
546 
547  override void OnItemLocationChanged ( EntityAI old_owner, EntityAI new_owner )
548  {
549  super.OnItemLocationChanged(old_owner, new_owner);
550 
551  if ( g_Game.IsServer() )
552  {
553  this.RefreshState();
554 
555  // TAKE ACTIVE TRAP FROM VICINITY
556  if ( old_owner == NULL && new_owner != NULL && IsActive() ) // !!! lebo nefunguju zlozene podmienky v if-e
557  {
558  // TAKE INTO HANDS
559  if ( new_owner.ClassName() == "PlayerBase" )
560  {
561  SnapOnObject( new_owner );
562  }
563  else // TAKE INTO BACKPACK, ETC ... // !!! lebo nefunguje elseif
564  {
565  if ( new_owner.GetHierarchyRootPlayer().ClassName() == "PlayerBase" )
566  {
567  SnapOnObject( new_owner.GetHierarchyRootPlayer() );
568  }
569  }
570  }
571  }
572 
573  }
574 
575  override void EEItemAttached(EntityAI item, string slot_name)
576  {
577  super.EEItemAttached(item, slot_name);
578 
579  if ( g_Game.IsServer() )
580  {
581  this.RefreshState();
582  }
583  }
584 
585  override void EEItemDetached (EntityAI item, string slot_name)
586  {
587  super.EEItemDetached(item, slot_name);
588 
589  if ( g_Game.IsServer() )
590  {
591  this.RefreshState();
592  }
593  }
594 
595  override bool CanPutInCargo( EntityAI parent )
596  {
597  if( !super.CanPutInCargo(parent) ) {return false;}
598  return IsTakeable();
599  }
600 
601  override bool CanPutIntoHands ( EntityAI parent )
602  {
603  if( !super.CanPutIntoHands( parent ) )
604  {
605  return false;
606  }
607  return IsTakeable();
608  }
609 
610  override bool CanRemoveFromHands ( EntityAI parent )
611  {
612  return IsTakeable();
613  }
614 
615  override bool CanBePlaced( Man player, vector position )
616  {
617  return IsPlaceableAtPosition( position );
618  }
619 
620  override string CanBePlacedFailMessage( Man player, vector position )
621  {
622  return "Trap can't be placed on this surface type.";
623  }
624 
625  //================================================================
626  // ADVANCED PLACEMENT
627  //================================================================
628 
630  {
631  if ( GetGame().IsMultiplayer() && GetGame().IsClient() || !GetGame().IsMultiplayer() )
632  {
634  {
636  }
637  }
638  }
639 
641  {
642  if ( GetGame().IsMultiplayer() && GetGame().IsClient() || !GetGame().IsMultiplayer() )
643  {
646  }
647  }
648 
649  override void SetActions()
650  {
651  super.SetActions();
652 
654  }
655 }
ItemBase
Definition: InventoryItem.c:445
GetGame
proto native CGame GetGame()
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
ACTIVATING
@ ACTIVATING
Definition: TrapBase.c:3
RefreshState
void RefreshState()
Definition: TrapBase.c:356
LocalDropEntity
bool LocalDropEntity(notnull EntityAI item)
Definition: EntityAI.c:1429
IsDeploySound
bool IsDeploySound()
Definition: ItemBase.c:3983
m_InfoDamageManipulation
string m_InfoDamageManipulation
Definition: TrapBase.c:27
Error
void Error(string err)
Messagebox with error message.
Definition: EnDebug.c:42
CanPutIntoHands
override bool CanPutIntoHands(EntityAI parent)
Definition: TrapBase.c:601
CanPlayDeployLoopSound
bool CanPlayDeployLoopSound()
Definition: ItemBase.c:4015
OnVariablesSynchronized
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
Definition: TrapBase.c:77
m_IsInProgress
protected bool m_IsInProgress
Definition: TrapBase.c:17
~TrapBase
void ~TrapBase()
Definition: TrapBase.c:68
CGame::ObjectDelete
proto native void ObjectDelete(Object obj)
CanDropEntity
bool CanDropEntity(notnull EntityAI item)
Returns if item can be dropped out from this entity.
Definition: EntityAI.c:1462
PlayDeployLoopSound
void PlayDeployLoopSound()
Definition: TrapBase.c:629
AddAction
void AddAction(typename actionName)
Definition: AdvancedCommunication.c:86
m_InfoSetup
string m_InfoSetup
Definition: TrapBase.c:25
StopDeployLoopSound
void StopDeployLoopSound()
Definition: TrapBase.c:640
EffectSound::SetSoundFadeOut
void SetSoundFadeOut(float fade_out)
Definition: EffectSound.c:142
GetHierarchyRootPlayer
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
SetupTrapPlayer
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Definition: TrapBase.c:415
SnapOnObject
void SnapOnObject(EntityAI victim)
Definition: TrapBase.c:229
Print
proto void Print(void var)
Prints content of variable to console/log.
GameInventory::AttachmentCount
proto native int AttachmentCount()
Returns count of attachments attached to this item.
SEffectManager::DestroySound
static bool DestroySound(EffectSound sound_effect)
Definition: EffectManager.c:114
m_TrapTrigger
protected TrapTrigger m_TrapTrigger
Definition: TrapBase.c:32
SetSynchDirty
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
AddDefect
void AddDefect()
Definition: TrapBase.c:437
m_AddActivationDefect
bool m_AddActivationDefect
Definition: TrapBase.c:14
EffectSound::IsSoundPlaying
bool IsSoundPlaying()
Definition: EffectSound.c:166
TrapBase::OnItemLocationChanged
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition: Trap_LandMine.c:65
HideSelection
void HideSelection(string selection_name)
Hides selection of the given name. Must be configed in config.hpp and models.cfg.
Definition: EntityAI.c:1840
EEItemAttached
override void EEItemAttached(EntityAI item, string slot_name)
Definition: TrapBase.c:575
IsTakeable
override bool IsTakeable()
Definition: TrapBase.c:177
SEffectManager::PlaySound
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Definition: EffectManager.c:61
m_AnimationPhaseGrounded
string m_AnimationPhaseGrounded
Definition: TrapBase.c:21
ActionActivateTrap
Definition: ActionActivateTrap.c:16
m_WasActivatedOrDeactivated
bool m_WasActivatedOrDeactivated
Definition: TrapBase.c:19
EEItemDetached
override void EEItemDetached(EntityAI item, string slot_name)
Definition: TrapBase.c:585
Serializer::Write
proto bool Write(void value_out)
Serializer
Serialization general interface.
Definition: Serializer.c:55
EEDelete
override void EEDelete(EntityAI parent)
Definition: TrapBase.c:110
PlayerIdentity
Player description.
Definition: gameplay.c:316
CreateTrigger
void CreateTrigger()
Definition: TrapBase.c:537
TrapBase
void TrapBase()
Definition: TrapBase.c:36
SetInactive
void SetInactive(bool stop_timer=true)
Definition: TrapBase.c:502
PlayDeploySound
void PlayDeploySound()
Definition: ItemBase.c:3988
SoundTypeTrap
SoundTypeTrap
Definition: TrapBase.c:1
EffectSound::SoundStop
void SoundStop()
Definition: EffectSound.c:300
EffectSound
Definition: EffectSound.c:1
SetupTrap
void SetupTrap()
Definition: TrapBase.c:404
GetHierarchyParent
proto native EntityAI GetHierarchyParent()
Returns direct parent of current entity.
PlayerBase
Definition: PlayerBaseClient.c:1
vector
Definition: EnConvert.c:95
TrapBase::SetActions
override void SetActions()
Definition: Trap_Bear.c:133
m_NeedActivation
bool m_NeedActivation
Definition: TrapBase.c:9
m_InfoDeactivated
string m_InfoDeactivated
Definition: TrapBase.c:26
m_DeployLoopSound
ref protected EffectSound m_DeployLoopSound
Definition: TrapBase.c:34
CGame::RPCSingleParam
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=NULL)
see CGame.RPC
Definition: Game.c:749
m_AnimationPhaseTriggered
string m_AnimationPhaseTriggered
Definition: TrapBase.c:23
SetActive
void SetActive()
Definition: TrapBase.c:445
ERPCs
ERPCs
Definition: ERPCs.c:1
CanBePlacedFailMessage
override string CanBePlacedFailMessage(Man player, vector position)
Definition: TrapBase.c:620
CGame::GetInventoryItemSize
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
OnRPC
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Definition: TrapBase.c:310
IsPlaceableAtPosition
bool IsPlaceableAtPosition(vector position)
Definition: TrapBase.c:215
m_DefectRate
float m_DefectRate
Definition: TrapBase.c:10
m_Timer
protected ref Timer m_Timer
Definition: TrapBase.c:31
OnStoreSave
override void OnStoreSave(ParamsWriteContext ctx)
Definition: TrapBase.c:122
IsActivable
bool IsActivable()
Definition: TrapBase.c:187
m_DamagePlayers
float m_DamagePlayers
Definition: TrapBase.c:11
CanPutInCargo
override bool CanPutInCargo(EntityAI parent)
Definition: TrapBase.c:595
version
version
Definition: $PBOPREFIX$.txt:4
RegisterNetSyncVariableBool
proto native void RegisterNetSyncVariableBool(string variableName)
m_InitWaitTime
enum SoundTypeTrap m_InitWaitTime
TrapBase::GetLoopDeploySoundset
override string GetLoopDeploySoundset()
Definition: Trap_Bear.c:128
StartDeactivate
void StartDeactivate(PlayerBase player)
Definition: TrapBase.c:493
m_InfoDamage
string m_InfoDamage
Definition: TrapBase.c:28
TrapBase::OnSteppedOn
override void OnSteppedOn(EntityAI victim)
Definition: Trap_Bear.c:16
m_AddDeactivationDefect
bool m_AddDeactivationDefect
Definition: TrapBase.c:15
vector::Distance
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Serializer::Read
proto bool Read(void value_in)
TrapBase::StartActivate
override void StartActivate(PlayerBase player)
Definition: Trap_LandMine.c:16
GameInventory::GetAttachmentFromIndex
proto native EntityAI GetAttachmentFromIndex(int index)
g_Game
DayZGame g_Game
Definition: DayZGame.c:2841
m_InfoActivationTime
string m_InfoActivationTime
Definition: TrapBase.c:29
IsInactive
bool IsInactive()
Definition: TrapBase.c:167
SetPosition
proto native void SetPosition(vector position)
SEffectManager
Definition: EffectManager.c:1
EntityAI
Base native class of all vehicles in game.
Definition: Building.c:4
IsActive
bool IsActive()
Definition: TrapBase.c:158
IsPlaceable
bool IsPlaceable()
Definition: TrapBase.c:197
GetInventory
proto native GameInventory GetInventory()
Synch
protected void Synch(EntityAI victim)
Definition: TrapBase.c:297
OnStoreLoad
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition: TrapBase.c:132
m_IsActive
protected bool m_IsActive
Definition: TrapBase.c:16
TrapBase
Definition: Trap_Bear.c:1
TrapBase::OnActivate
override void OnActivate()
Definition: Trap_Bear.c:98
m_AnimationPhaseSet
string m_AnimationPhaseSet
Definition: TrapBase.c:22
m_DamageOthers
float m_DamageOthers
Definition: TrapBase.c:12
CanRemoveFromHands
override bool CanRemoveFromHands(EntityAI parent)
Definition: TrapBase.c:610
CanBePlaced
override bool CanBePlaced(Man player, vector position)
Definition: TrapBase.c:615