DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ActionCondition()

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

См. определение в файле ActionUnlockDoors.c строка 28

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
39 // Check door for related lock inventory attachments
40 AdditionalDoorInfo doorInfo = building.GetDoorInfo(doorIndex);
41 if (doorInfo && doorInfo.m_RelatedInventorySlotNames)
42 {
43 foreach(string relatedSlotName: doorInfo.m_RelatedInventorySlotNames)
44 {
45 EntityAI attachmentEntity = building.FindAttachmentBySlotName(relatedSlotName);
46 if (!attachmentEntity)
47 continue;
48
49 ItemBase attachment = ItemBase.Cast(attachmentEntity);
50 if (attachment && attachment.IsExternalLockType())
51 return false;
52 }
53 }
54
55 if (doorIndex != -1 && tool.GetKeyCompatibilityType() & building.GetLockCompatibilityType(doorIndex))
56 return building.IsDoorLocked(doorIndex);
57 }
58
59 return false;
60 }
class LogManager EntityAI
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Определения ActionBase.c:1290
bool IsBuilding(ActionTarget target)
Определения ActionBase.c:1280
class GP5GasMask extends MaskBase ItemBase
ref TStringArray m_RelatedInventorySlotNames
Lock compatibility type, now in door config. Lockpick enabled by default if undefined.
Определения AdditionalDoorsInfo.c:12
AdditionalDoorInfo GetDoorInfo(int doorIdx)
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.

Перекрестные ссылки ActionTarget(), Class::CastTo(), UAMaxDistances::DEFAULT, Building::GetDoorIndex(), Building::GetDoorInfo(), Building::GetLockCompatibilityType(), IsBuilding(), Building::IsDoorLocked(), IsInReach() и AdditionalDoorInfo::m_RelatedInventorySlotNames.