12 proto native
int GetLaddersCount();
13 proto native
vector GetLadderPosTop(
int ladderIndex);
14 proto native
vector GetLadderPosBottom(
int ladderIndex);
17 proto native
int GetDoorIndex(
int componentIndex);
20 proto native
int GetDoorCount();
23 proto native
bool IsDoorOpen(
int index);
26 proto native
bool IsDoorOpening(
int index);
29 proto native
bool IsDoorOpeningAjar(
int index);
32 proto native
bool IsDoorClosing(
int index);
35 proto native
bool IsDoorOpened(
int index);
38 proto native
bool IsDoorOpenedAjar(
int index);
41 proto native
bool IsDoorClosed(
int index);
44 proto native
bool IsDoorLocked(
int index);
47 proto native
void PlayDoorSound(
int index);
50 proto native
void OpenDoor(
int index);
53 proto native
void CloseDoor(
int index);
56 proto native
void LockDoor(
int index,
bool force =
false);
59 proto native
void UnlockDoor(
int index,
bool animate =
true);
62 proto native
vector GetDoorSoundPos(
int index);
65 proto native
float GetDoorSoundDistance(
int index);
68 proto native
void OutputDoorLog();
71 int GetNearestDoorBySoundPos(
vector position)
73 float smallestDist =
float.MAX;
76 int count = GetDoorCount();
77 for (
int i = 0; i < count; i++)
79 float dist =
vector.DistanceSq(GetDoorSoundPos(i), position);
80 if (dist < smallestDist)
130 bool CanDoorBeOpened(
int doorIndex,
bool checkIfLocked =
false)
132 if (IsDoorOpen(doorIndex))
137 if (IsDoorLocked(doorIndex))
142 if (!IsDoorLocked(doorIndex))
148 bool CanDoorBeClosed(
int doorIndex)
150 return IsDoorOpen(doorIndex);
154 bool CanDoorBeLocked(
int doorIndex)
156 return (!IsDoorOpen(doorIndex) && !IsDoorLocked(doorIndex));
167 int GetLockCompatibilityType(
int doorIdx)
172 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
184 if (Gizmo_IsSupported())
190 super.GetDebugActions(outputList);
195 if (super.OnAction(action_id, player, ctx))
211 case EActions.BUILDING_PLAY_DOOR_SOUND:
212 PlayDoorSound(GetNearestDoorBySoundPos(player.GetPosition()));
225 OpenDoor(GetNearestDoorBySoundPos(player.GetPosition()));
228 CloseDoor(GetNearestDoorBySoundPos(player.GetPosition()));
231 LockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
234 UnlockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
241 override bool IsBuilding()
261 g_Game.ConfigGetIntArray(
"cfgVehicles " +
GetType() +
" InteractActions", m_InteractActions);