DayZ 1.24
Loading...
Searching...
No Matches
ActionLockDoors Class Reference
Inheritance diagram for ActionLockDoors:
[legend]
Collaboration diagram for ActionLockDoors:
[legend]

Protected Member Functions

void LockDoor (ActionTarget target)
 
override void OnFinishProgressServer (ActionData action_data)
 

Private Member Functions

void ActionLockDoors ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 9 of file ActionLockDoors.c.

Constructor & Destructor Documentation

◆ ActionLockDoors()

void ActionLockDoors::ActionLockDoors ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

override bool ActionLockDoors::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 27 of file ActionLockDoors.c.

28 {
29 if (!target) return false;
30 //if( IsDamageDestroyed(action_data.m_Target) ) return false;
31 if (!IsBuilding(target)) return false;
32 if (!IsInReach(player, target, UAMaxDistances.DEFAULT)) return false;
33
34 Building building;
35 if (Class.CastTo(building, target.GetObject()))
36 {
37 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
38 if (doorIndex != -1)
39 return building.CanDoorBeLocked(doorIndex);
40 }
41 return false;
42 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:856
bool IsBuilding(ActionTarget target)
Definition ActionBase.c:846
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float DEFAULT
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), UAMaxDistances::DEFAULT, IsBuilding(), and IsInReach().

◆ CreateConditionComponents()

override void ActionLockDoors::CreateConditionComponents ( )
inlineprivate

Definition at line 21 of file ActionLockDoors.c.

22 {
25 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ LockDoor()

void ActionLockDoors::LockDoor ( ActionTarget target)
inlineprotected

Definition at line 44 of file ActionLockDoors.c.

45 {
46 Building building;
47
48 if (Class.CastTo(building, target.GetObject()))
49 {
50 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
51 if (doorIndex != -1)
52 building.LockDoor(doorIndex);
53 }
54 }

References Class::CastTo().

Referenced by OnFinishProgressServer().

◆ OnFinishProgressServer()

override void ActionLockDoors::OnFinishProgressServer ( ActionData action_data)
inlineprotected

Definition at line 56 of file ActionLockDoors.c.

57 {
58 LockDoor(action_data.m_Target);
59
60 //Damage the Lockpick
61 //float dmg = action_data.m_MainItem.GetMaxHealth() * 0.04; //Multiply max health by 'x' amount depending on number of usages wanted (0.04 = 25)
62
63 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
64
65 float skillLevel = action_data.m_Player.GetSoftSkillsManager().GetSpecialtyLevel();
66 float appliedDamage = 5 + 2 * skillLevel;
67 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, appliedDamage);
68 }
void LockDoor(ActionTarget target)

References LockDoor(), and m_SpecialtyWeight.


The documentation for this class was generated from the following file: