Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
trapbase.c File Reference

Go to the source code of this file.

Enumerations

enum  SoundTypeTrap { ACTIVATING = 5 }

Functions

void AddDefect ()
bool CanBeClapped ()
 DEPRECATED Set if trap can be disarmed using ActionClapBearTrapWithThisItem.
bool CanBeDisarmed ()
override bool CanBePlaced (Man player, vector position)
override bool CanPutInCargo (EntityAI parent)
override bool CanPutIntoHands (EntityAI parent)
override bool CanRemoveFromHands (EntityAI parent)
void CreateTrigger ()
void DamageClothing (PlayerBase player)
void DeferredEnableTrigger ()
void DeleteTrigger ()
void Disarm ()
override void EEDelete (EntityAI parent)
override void EEItemAttached (EntityAI item, string slot_name)
override void EEItemDetached (EntityAI item, string slot_name)
EntityAI GetClosestCarWheel (EntityAI victim)
bool GetDisarmed ()
 DEPRECATED.
TrapTrigger GetTrapTrigger ()
bool IsActivable ()
bool IsActive ()
bool IsInactive ()
bool IsPlaceable ()
bool IsPlaceableAtPosition (vector position)
override bool IsTakeable ()
void OnActivate ()
void OnDisarm ()
 also called from RPC on client
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
void OnSteppedOn (EntityAI victim)
void OnSteppedOut (EntityAI victim)
override bool OnStoreLoad (ParamsReadContext ctx, int version)
override void OnStoreSave (ParamsWriteContext ctx)
void OnUpdate (EntityAI victim)
override void OnVariablesSynchronized ()
 this event is called all variables are synchronized on client
void PlayDeployLoopSound ()
void RefreshState ()
void RemoveFromObject (EntityAI victim)
override void SetActions ()
void SetActive ()
void SetDisarmed (bool disarmed)
 DEPRECATED.
void SetInactive (bool stop_timer=true)
void SetupTrap ()
void SetupTrapPlayer (PlayerBase player, bool set_position=true)
void SnapOnObject (EntityAI victim)
void StartActivate (PlayerBase player)
void StartDeactivate (PlayerBase player)
void StopDeployLoopSound ()
 DEPRECATED.
void Synch (EntityAI victim)
 keeping "step" here for consistency only
void TrapBase ()

Variables

const int DAMAGE_TRIGGER_MINE = 75
bool m_AddActivationDefect
bool m_AddDeactivationDefect
string m_AnimationPhaseGrounded
string m_AnimationPhaseSet
string m_AnimationPhaseTriggered
ref array< intm_ClothingDmg
float m_DamageOthers
float m_DamagePlayers
float m_DefectRate
ref EffectSound m_DeployLoopSound
 DEPRECATED.
bool m_Disarmed = false
string m_InfoActivationTime
string m_InfoDamage
string m_InfoDamageManipulation
string m_InfoDeactivated
string m_InfoSetup
float m_InitWaitTime
bool m_IsActive
bool m_IsInProgress
bool m_NeedActivation
ref Timer m_Timer
TrapTrigger m_TrapTrigger
ref Timer m_UpdateTimer
bool m_WasActivatedOrDeactivated
 DEPRECATED Used for explosive traps to prevent detonation after destroying through disarm action.
enum SoundTypeTrap SPAWN_FLAGS = ECE_LOCAL
const float UPDATE_TIMER_INTERVAL = 0.05

Enumeration Type Documentation

◆ SoundTypeTrap

Enumerator
ACTIVATING 

Definition at line 1 of file trapbase.c.

Function Documentation

◆ AddDefect()

void AddDefect ( )
protected

Definition at line 396 of file trapbase.c.

References g_Game, and m_DefectRate.

Referenced by SetActive(), SetInactive(), and ItemBase::SetUsed().

◆ CanBeClapped()

bool CanBeClapped ( )
protected

DEPRECATED Set if trap can be disarmed using ActionClapBearTrapWithThisItem.

Definition at line 578 of file trapbase.c.

◆ CanBeDisarmed()

bool CanBeDisarmed ( )
protected

Definition at line 584 of file trapbase.c.

◆ CanBePlaced()

override bool CanBePlaced ( Man player,
vector position )
protected

Definition at line 572 of file trapbase.c.

References IsPlaceableAtPosition().

◆ CanPutInCargo()

override bool CanPutInCargo ( EntityAI parent)
protected

Definition at line 547 of file trapbase.c.

References IsTakeable().

◆ CanPutIntoHands()

override bool CanPutIntoHands ( EntityAI parent)
protected

Definition at line 557 of file trapbase.c.

References IsTakeable().

◆ CanRemoveFromHands()

override bool CanRemoveFromHands ( EntityAI parent)
protected

Definition at line 567 of file trapbase.c.

References IsTakeable().

◆ CreateTrigger()

◆ DamageClothing()

void DamageClothing ( PlayerBase player)
protected

Definition at line 654 of file trapbase.c.

References m_ClothingDmg.

Referenced by OnSteppedOn().

◆ DeferredEnableTrigger()

void DeferredEnableTrigger ( )
protected

Definition at line 487 of file trapbase.c.

References m_TrapTrigger.

Referenced by CreateTrigger().

◆ DeleteTrigger()

void DeleteTrigger ( )
protected

Definition at line 478 of file trapbase.c.

References m_TrapTrigger.

Referenced by EEItemLocationChanged(), SetInactive(), and StartDeactivate().

◆ Disarm()

void Disarm ( )
protected

Definition at line 204 of file trapbase.c.

References g_Game, TrapBase::OnDisarm(), RefreshState(), and SetInactive().

◆ EEDelete()

override void EEDelete ( EntityAI parent)
protected

Definition at line 100 of file trapbase.c.

References g_Game, and m_TrapTrigger.

◆ EEItemAttached()

override void EEItemAttached ( EntityAI item,
string slot_name )
protected

Definition at line 518 of file trapbase.c.

References g_Game, and RefreshState().

◆ EEItemDetached()

override void EEItemDetached ( EntityAI item,
string slot_name )
protected

Definition at line 526 of file trapbase.c.

References g_Game, and RefreshState().

◆ GetClosestCarWheel()

EntityAI GetClosestCarWheel ( EntityAI victim)
protected

carscript specific handling (not all traps are uses this)

ruined wheel, bail out

ignore all spare wheel

actual, healthy wheel, let it pass

Definition at line 613 of file trapbase.c.

References GameInventory::AttachmentCount(), vector::Distance(), GameInventory::GetAttachmentFromIndex(), GetPosition(), and slotName.

Referenced by OnUpdate(), and TrapBase::OnUpdate().

◆ GetDisarmed()

bool GetDisarmed ( )
protected

DEPRECATED.

Definition at line 596 of file trapbase.c.

References m_Disarmed.

◆ GetTrapTrigger()

TrapTrigger GetTrapTrigger ( )
protected

Definition at line 80 of file trapbase.c.

References m_TrapTrigger.

◆ IsActivable()

bool IsActivable ( )
protected

Definition at line 167 of file trapbase.c.

References IsActive(), m_IsInProgress, and m_NeedActivation.

◆ IsActive()

bool IsActive ( )
protected

Definition at line 146 of file trapbase.c.

References m_IsActive, and m_IsInProgress.

◆ IsInactive()

bool IsInactive ( )
protected

Definition at line 151 of file trapbase.c.

References IsActive(), and m_IsInProgress.

Referenced by RefreshState().

◆ IsPlaceable()

bool IsPlaceable ( )
protected

Definition at line 172 of file trapbase.c.

References vector::DistanceSq(), IsPlaceableAtPosition(), and Math::SqrFloat().

◆ IsPlaceableAtPosition()

bool IsPlaceableAtPosition ( vector position)
protected

Definition at line 190 of file trapbase.c.

References g_Game.

Referenced by CanBePlaced(), and IsPlaceable().

◆ IsTakeable()

override bool IsTakeable ( )
protected

Definition at line 157 of file trapbase.c.

References IsActive(), and m_IsInProgress.

◆ OnActivate()

◆ OnDisarm()

void OnDisarm ( )
protected

also called from RPC on client

◆ OnItemLocationChanged()

override void OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
protected

Definition at line 493 of file trapbase.c.

References g_Game, IsActive(), RefreshState(), and SnapOnObject().

◆ OnPlacementComplete()

override void OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
protected

Definition at line 534 of file trapbase.c.

References g_Game, and SetPosition().

◆ OnRPC()

override void OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
protected

Definition at line 295 of file trapbase.c.

References g_Game, TrapBase::OnDisarm(), Serializer::Read(), and SnapOnObject().

◆ OnSteppedOn()

void OnSteppedOn ( EntityAI victim)
protected

Definition at line 273 of file trapbase.c.

References SetInactive().

◆ OnSteppedOut()

void OnSteppedOut ( EntityAI victim)
protected

Definition at line 166 of file trap_landmine.c.

References m_UpdateTimer.

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
protected

Definition at line 120 of file trapbase.c.

References Serializer::Read(), SetActive(), and StartActivate().

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext ctx)
protected

Definition at line 111 of file trapbase.c.

References m_IsActive, m_IsInProgress, and Serializer::Write().

◆ OnUpdate()

void OnUpdate ( EntityAI victim)
protected

Definition at line 89 of file trap_landmine.c.

References GetClosestCarWheel(), and TrapBase::OnServerSteppedOn().

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
protected

this event is called all variables are synchronized on client

Definition at line 86 of file trapbase.c.

References g_Game, m_IsActive, m_IsInProgress, SetActive(), and StartActivate().

◆ PlayDeployLoopSound()

void PlayDeployLoopSound ( )
protected

◆ RefreshState()

◆ RemoveFromObject()

void RemoveFromObject ( EntityAI victim)
protected

Definition at line 268 of file trapbase.c.

References TrapBase::OnSteppedOut().

◆ SetActions()

override void SetActions ( )
protected

Definition at line 605 of file trapbase.c.

References ActionActivateTrap(), and AddAction().

◆ SetActive()

◆ SetDisarmed()

void SetDisarmed ( bool disarmed)
protected

DEPRECATED.

Definition at line 590 of file trapbase.c.

References m_Disarmed.

◆ SetInactive()

◆ SetupTrap()

void SetupTrap ( )
protected

Definition at line 369 of file trapbase.c.

References g_Game, and SetupTrapPlayer().

◆ SetupTrapPlayer()

void SetupTrapPlayer ( PlayerBase player,
bool set_position = true )
protected

◆ SnapOnObject()

void SnapOnObject ( EntityAI victim)
protected

◆ StartActivate()

void StartActivate ( PlayerBase player)
protected

◆ StartDeactivate()

void StartDeactivate ( PlayerBase player)
protected

Definition at line 209 of file trap_tripwire.c.

References DeleteTrigger(), FOLDED, and SetState().

Referenced by EEKilled(), and OnItemLocationChanged().

◆ StopDeployLoopSound()

void StopDeployLoopSound ( )
protected

DEPRECATED.

◆ Synch()

void Synch ( EntityAI victim)
protected

keeping "step" here for consistency only

Definition at line 281 of file trapbase.c.

References g_Game.

Referenced by OnServerSteppedOn(), TrapBase::OnServerSteppedOn(), and SnapOnObject().

◆ TrapBase()

Variable Documentation

◆ DAMAGE_TRIGGER_MINE

const int DAMAGE_TRIGGER_MINE = 75
protected

Definition at line 14 of file trapbase.c.

Referenced by OnSteppedOn().

◆ m_AddActivationDefect

bool m_AddActivationDefect
protected

Definition at line 23 of file trapbase.c.

Referenced by SetActive(), and TrapBase().

◆ m_AddDeactivationDefect

bool m_AddDeactivationDefect
protected

Definition at line 24 of file trapbase.c.

Referenced by LandMineTrap(), SetInactive(), and TrapBase().

◆ m_AnimationPhaseGrounded

string m_AnimationPhaseGrounded
protected

Definition at line 32 of file trapbase.c.

Referenced by TrapBase::BearTrap(), FoldTripWire(), RefreshState(), TrapBase(), and TripwireTrap().

◆ m_AnimationPhaseSet

string m_AnimationPhaseSet
protected

◆ m_AnimationPhaseTriggered

string m_AnimationPhaseTriggered
protected

◆ m_ClothingDmg

ref array<int> m_ClothingDmg
protected

Definition at line 46 of file trapbase.c.

Referenced by DamageClothing(), and LandMineTrap().

◆ m_DamageOthers

float m_DamageOthers
protected

Definition at line 21 of file trapbase.c.

Referenced by TrapBase::BearTrap(), SnapOnObject(), and TrapBase().

◆ m_DamagePlayers

float m_DamagePlayers
protected

Definition at line 20 of file trapbase.c.

Referenced by TrapBase::BearTrap(), LandMineTrap(), SnapOnObject(), TrapBase(), and TripwireTrap().

◆ m_DefectRate

float m_DefectRate
protected

◆ m_DeployLoopSound

ref EffectSound m_DeployLoopSound
protected

DEPRECATED.

Definition at line 682 of file trapbase.c.

◆ m_Disarmed

bool m_Disarmed = false
protected

Definition at line 28 of file trapbase.c.

Referenced by GetDisarmed(), and SetDisarmed().

◆ m_InfoActivationTime

string m_InfoActivationTime
protected

Definition at line 40 of file trapbase.c.

Referenced by LandMineTrap(), TrapBase(), and TripwireTrap().

◆ m_InfoDamage

string m_InfoDamage
protected

Definition at line 39 of file trapbase.c.

Referenced by TrapBase().

◆ m_InfoDamageManipulation

string m_InfoDamageManipulation
protected

Definition at line 38 of file trapbase.c.

Referenced by TrapBase().

◆ m_InfoDeactivated

string m_InfoDeactivated
protected

Definition at line 37 of file trapbase.c.

Referenced by TrapBase().

◆ m_InfoSetup

string m_InfoSetup
protected

Definition at line 36 of file trapbase.c.

Referenced by TrapBase().

◆ m_InitWaitTime

float m_InitWaitTime
protected

Definition at line 17 of file trapbase.c.

Referenced by TrapBase::BearTrap(), LandMineTrap(), StartActivate(), TrapBase(), and TripwireTrap().

◆ m_IsActive

bool m_IsActive
protected

Definition at line 25 of file trapbase.c.

◆ m_IsInProgress

bool m_IsInProgress
protected

◆ m_NeedActivation

bool m_NeedActivation
protected

Definition at line 18 of file trapbase.c.

Referenced by IsActivable(), SetupTrapPlayer(), TrapBase(), and TripwireTrap().

◆ m_Timer

ref Timer m_Timer
protected

Definition at line 42 of file trapbase.c.

◆ m_TrapTrigger

◆ m_UpdateTimer

ref Timer m_UpdateTimer
protected

Definition at line 43 of file trapbase.c.

◆ m_WasActivatedOrDeactivated

bool m_WasActivatedOrDeactivated
protected

DEPRECATED Used for explosive traps to prevent detonation after destroying through disarm action.

Definition at line 30 of file trapbase.c.

Referenced by RefreshState(), SetActive(), SetInactive(), and TrapBase().

◆ SPAWN_FLAGS

enum SoundTypeTrap SPAWN_FLAGS = ECE_LOCAL

Referenced by CreateTrigger().

◆ UPDATE_TIMER_INTERVAL

const float UPDATE_TIMER_INTERVAL = 0.05
protected

Definition at line 15 of file trapbase.c.

Referenced by OnSteppedOn(), and TrapBase::OnSteppedOn().