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

Protected Member Functions

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

Private Member Functions

void ActionUnlockDoors ()
 
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 ActionUnlockDoors.c.

Constructor & Destructor Documentation

◆ ActionUnlockDoors()

void ActionUnlockDoors::ActionUnlockDoors ( )
inlineprivate

Definition at line 11 of file ActionUnlockDoors.c.

12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17 m_Text = "#unlock";
18 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, m_FullBody, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 26 of file ActionUnlockDoors.c.

27 {
28 if (!target) return false;
29 //if( IsDamageDestroyed(action_data.m_Target) ) return false;
30 if (!IsBuilding(target)) return false;
31 if (!IsInReach(player, target, UAMaxDistances.DEFAULT)) return false;
32
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.IsDoorLocked(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 ActionUnlockDoors::CreateConditionComponents ( )
inlineprivate

Definition at line 20 of file ActionUnlockDoors.c.

21 {
24 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ OnFinishProgressServer()

override void ActionUnlockDoors::OnFinishProgressServer ( ActionData action_data)
inlineprotected

Definition at line 56 of file ActionUnlockDoors.c.

57 {
58 UnlockDoor(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
69 }
float m_SpecialtyWeight
Definition ActionBase.c:68
void UnlockDoor(ActionTarget target)

References m_SpecialtyWeight, and UnlockDoor().

◆ UnlockDoor()

void ActionUnlockDoors::UnlockDoor ( ActionTarget target)
inlineprotected

Definition at line 44 of file ActionUnlockDoors.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.UnlockDoor(doorIndex);
53 }
54 }

References Class::CastTo().

Referenced by OnFinishProgressServer().


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