DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionUnlockDoors.c
См. документацию.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.UNLOCK);
6 }
7};
8
10{
11 protected const float APPLIED_DMG = 6;
12
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
19 m_Text = "#unlock";
20 }
21
27
28 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
29 {
30 if( !IsBuilding(target) ) return false;
31 if( !IsInReach(player, target, UAMaxDistances.DEFAULT) ) return false;
32
33 Building building;
34 ToolBase tool;
35 if (Class.CastTo(building, target.GetObject())&& Class.CastTo(tool, item))
36 {
37 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
38 if (doorIndex != -1 && tool.GetKeyCompatibilityType() & building.GetLockCompatibilityType(doorIndex))
39 return building.IsDoorLocked(doorIndex);
40 }
41 return false;
42 }
43
44 protected void UnlockDoor(ActionTarget target)
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 {
53 building.UnlockDoor(doorIndex);
54 }
55 }
56 }
57
58 override void OnFinishProgressServer( ActionData action_data )
59 {
60 UnlockDoor(action_data.m_Target);
61
62 //Damage the Lockpick
63 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, APPLIED_DMG);
64
65 }
66
67 override bool IsLockTargetOnUse()
68 {
69 return false;
70 }
71};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
int m_StanceMask
Определения ActionBase.c:68
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Определения ActionBase.c:1181
string m_Text
Определения ActionBase.c:64
ref CCIBase m_ConditionItem
Определения ActionBase.c:70
bool IsBuilding(ActionTarget target)
Определения ActionBase.c:1171
bool m_FullBody
Определения ActionBase.c:67
ref CCTBase m_ConditionTarget
Определения ActionBase.c:71
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
void UnlockDoor(ActionTarget target)
Определения ActionUnlockDoors.c:44
override void OnFinishProgressServer(ActionData action_data)
Определения ActionUnlockDoors.c:58
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionUnlockDoors.c:28
override void CreateConditionComponents()
Определения ActionUnlockDoors.c:22
override bool IsLockTargetOnUse()
Определения ActionUnlockDoors.c:67
const float APPLIED_DMG
Определения ActionUnlockDoors.c:11
void ActionUnlockDoors()
Определения ActionUnlockDoors.c:13
override void CreateActionComponent()
Определения ActionUnlockDoors.c:3
int m_CommandUID
Определения AnimatedActionBase.c:143
proto native void UnlockDoor(int index, bool animate=true)
Unlocks the door if locked, AJAR animation optional.
int GetLockCompatibilityType(int doorIdx)
Which door is compatible with which key (door idx supplied). Bitwise.
proto native bool IsDoorLocked(int index)
When the door is locked.
proto native int GetDoorIndex(int componentIndex)
Gets the index of the door based on the view geometry component index.
Определения CCINonRuined.c:2
Определения CCTCursor.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения PlayerBaseClient.c:2
Определения BoneKnife.c:2
const float DEFAULT
Определения ActionConstants.c:112
const float UNLOCK
Определения ActionConstants.c:85
Определения ActionConstants.c:28
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.