PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
TrapBase.c File Reference

Enumerations

enum  SoundTypeTrap { ACTIVATING = 5 }
 

Functions

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

Variables

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

Enumeration Type Documentation

◆ SoundTypeTrap

Enumerator
ACTIVATING 

Function Documentation

◆ AddDefect()

void AddDefect ( )

References GetGame(), and m_DefectRate.

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

◆ CanBeClapped()

bool CanBeClapped ( )

DEPRECATED Set if trap can be disarmed using ActionClapBearTrapWithThisItem.

◆ CanBeDisarmed()

bool CanBeDisarmed ( )

◆ CanBePlaced()

override bool CanBePlaced ( Man  player,
vector  position 
)

◆ CanPutInCargo()

override bool CanPutInCargo ( EntityAI  parent)

References IsTakeable().

◆ CanPutIntoHands()

override bool CanPutIntoHands ( EntityAI  parent)

References IsTakeable().

◆ CanRemoveFromHands()

override bool CanRemoveFromHands ( EntityAI  parent)

References IsTakeable().

◆ CreateTrigger()

◆ DamageClothing()

protected void DamageClothing ( PlayerBase  player)

References m_ClothingDmg.

Referenced by OnSteppedOn().

◆ DeferredEnableTrigger()

void DeferredEnableTrigger ( )

References m_TrapTrigger, and TrapTrigger::SetEnabled().

Referenced by CreateTrigger().

◆ DeleteTrigger()

void DeleteTrigger ( )

◆ Disarm()

◆ EEDelete()

override void EEDelete ( EntityAI  parent)

◆ EEItemAttached()

override void EEItemAttached ( EntityAI  item,
string  slot_name 
)

References GetGame(), and RefreshState().

◆ EEItemDetached()

override void EEItemDetached ( EntityAI  item,
string  slot_name 
)

References GetGame(), and RefreshState().

◆ GetClosestCarWheel()

protected EntityAI GetClosestCarWheel ( EntityAI  victim)

carscript specific handling (not all traps are uses this)

ruined wheel, bail out

ignore all spare wheel

actual, healthy wheel, let it pass

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

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

◆ GetDisarmed()

bool GetDisarmed ( )

DEPRECATED.

References m_Disarmed.

◆ GetTrapTrigger()

TrapTrigger GetTrapTrigger ( )

References m_TrapTrigger.

◆ IsActivable()

bool IsActivable ( )

◆ IsActive()

bool IsActive ( )

References m_IsActive, and m_IsInProgress.

◆ IsInactive()

bool IsInactive ( )

References IsActive(), and m_IsInProgress.

Referenced by RefreshState().

◆ IsPlaceable()

◆ IsPlaceableAtPosition()

bool IsPlaceableAtPosition ( vector  position)

References g_Game, and GetGame().

Referenced by CanBePlaced(), and IsPlaceable().

◆ IsTakeable()

override bool IsTakeable ( )

References IsActive(), and m_IsInProgress.

◆ OnActivate()

◆ OnDisarm()

void OnDisarm ( )

also called from RPC on client

◆ OnItemLocationChanged()

override void OnItemLocationChanged ( EntityAI  old_owner,
EntityAI  new_owner 
)

◆ OnPlacementComplete()

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

References GetGame(), and SetPosition().

◆ OnRPC()

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

◆ OnSteppedOn()

void OnSteppedOn ( EntityAI  victim)

References SetInactive().

◆ OnSteppedOut()

void OnSteppedOut ( EntityAI  victim)

References m_UpdateTimer, and Timer::Stop().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext  ctx,
int  version 
)

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext  ctx)

◆ OnUpdate()

void OnUpdate ( EntityAI  victim)

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )

this event is called all variables are synchronized on client

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

◆ PlayDeployLoopSound()

void PlayDeployLoopSound ( )

◆ RefreshState()

◆ RemoveFromObject()

void RemoveFromObject ( EntityAI  victim)

◆ SetActions()

override void SetActions ( )

◆ SetActive()

◆ SetDisarmed()

void SetDisarmed ( bool  disarmed)

DEPRECATED.

References m_Disarmed.

◆ SetInactive()

◆ SetupTrap()

void SetupTrap ( )

References GetGame(), and SetupTrapPlayer().

◆ SetupTrapPlayer()

void SetupTrapPlayer ( PlayerBase  player,
bool  set_position = true 
)

◆ SnapOnObject()

◆ StartActivate()

◆ StartDeactivate()

void StartDeactivate ( PlayerBase  player)

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

Referenced by EEKilled(), and OnItemLocationChanged().

◆ StopDeployLoopSound()

void StopDeployLoopSound ( )

DEPRECATED.

◆ Synch()

protected void Synch ( EntityAI  victim)

keeping "step" here for consistency only

References GetGame(), and CGame::RPCSingleParam().

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

◆ TrapBase()

Variable Documentation

◆ DAMAGE_TRIGGER_MINE

protected const int DAMAGE_TRIGGER_MINE = 75

Referenced by OnSteppedOn().

◆ m_AddActivationDefect

bool m_AddActivationDefect

Referenced by SetActive(), and TrapBase().

◆ m_AddDeactivationDefect

bool m_AddDeactivationDefect

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

◆ m_AnimationPhaseGrounded

string m_AnimationPhaseGrounded

◆ m_AnimationPhaseSet

◆ m_AnimationPhaseTriggered

◆ m_ClothingDmg

protected ref array<int> m_ClothingDmg

Referenced by DamageClothing(), and LandMineTrap().

◆ m_DamageOthers

float m_DamageOthers

◆ m_DamagePlayers

◆ m_DefectRate

◆ m_DeployLoopSound

protected ref EffectSound m_DeployLoopSound

DEPRECATED.

◆ m_Disarmed

protected bool m_Disarmed = false

Referenced by GetDisarmed(), and SetDisarmed().

◆ m_InfoActivationTime

string m_InfoActivationTime

◆ m_InfoDamage

string m_InfoDamage

Referenced by TrapBase().

◆ m_InfoDamageManipulation

string m_InfoDamageManipulation

Referenced by TrapBase().

◆ m_InfoDeactivated

string m_InfoDeactivated

Referenced by TrapBase().

◆ m_InfoSetup

string m_InfoSetup

Referenced by TrapBase().

◆ m_InitWaitTime

◆ m_IsActive

protected bool m_IsActive

◆ m_IsInProgress

◆ m_NeedActivation

bool m_NeedActivation

◆ m_Timer

protected ref Timer m_Timer

◆ m_TrapTrigger

◆ m_UpdateTimer

protected ref Timer m_UpdateTimer

◆ m_WasActivatedOrDeactivated

bool m_WasActivatedOrDeactivated

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

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

◆ SPAWN_FLAGS

enum SoundTypeTrap SPAWN_FLAGS = ECE_LOCAL

Referenced by CreateTrigger().

◆ UPDATE_TIMER_INTERVAL

protected const float UPDATE_TIMER_INTERVAL = 0.05