DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionLockDoors.c
См. документацию.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.LOCK);
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_SpecialtyWeight = UASoftSkillsWeight.PRECISE_HIGH;
20 m_Text = "#lock_door";
21 }
22
28
29 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
30 {
31 if( !IsBuilding(target) ) return false;
32 if( !IsInReach(player, target, UAMaxDistances.DEFAULT) ) return false;
33
34 Building building;
35 ToolBase tool;
36 if (Class.CastTo(building, target.GetObject())&& Class.CastTo(tool, item))
37 {
38 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
39 if (doorIndex != -1 && tool.GetKeyCompatibilityType() & building.GetLockCompatibilityType(doorIndex))
40 return building.CanDoorBeLocked(doorIndex);
41 }
42 return false;
43 }
44
45 protected void LockDoor(ActionTarget target)
46 {
47 Building building;
48
49 if ( Class.CastTo(building, target.GetObject()) )
50 {
51 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
52 if ( doorIndex != -1 )
53 {
54 building.LockDoor(doorIndex);
55 }
56 }
57 }
58
59 override void OnFinishProgressServer( ActionData action_data )
60 {
61 LockDoor(action_data.m_Target);
62
63 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, APPLIED_DMG);
64 }
65
66 override bool IsLockTargetOnUse()
67 {
68 return false;
69 }
70};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
float m_SpecialtyWeight
Определения ActionBase.c:83
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 LockDoor(ActionTarget target)
Определения ActionLockDoors.c:45
override void CreateConditionComponents()
Определения ActionLockDoors.c:23
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionLockDoors.c:29
override void OnFinishProgressServer(ActionData action_data)
Определения ActionLockDoors.c:59
const float APPLIED_DMG
Определения ActionLockDoors.c:11
override bool IsLockTargetOnUse()
Определения ActionLockDoors.c:66
void ActionLockDoors()
Определения ActionLockDoors.c:13
override void CreateActionComponent()
Определения ActionLockDoors.c:3
int m_CommandUID
Определения AnimatedActionBase.c:143
proto native void LockDoor(int index, bool force=false)
Locks the door if not already locked, resets the door health. 'force = true' will close the door if o...
bool CanDoorBeLocked(int doorIndex)
Check if the door is closed and if the door is unlocked.
int GetLockCompatibilityType(int doorIdx)
Which door is compatible with which key (door idx supplied). Bitwise.
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 LOCK
Определения ActionConstants.c:84
Определения 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.