6 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
11 vector doorOpeningVecWS = pOwnerEntity.VectorToParent(vector.Forward);
12 if (doorComponent.GetAngleRange() < 0.0)
13 doorOpeningVecWS = -1.0 * doorOpeningVecWS;
16 pUserEntity.GetWorldTransform(userMat);
17 float dotP = vector.Dot(doorOpeningVecWS, userMat[3] - doorComponent.GetDoorPivotPointWS());
20 float controlValue = 1.0;
21 float currentState = doorComponent.GetDoorState();
22 if ((dotP < 0.0 && currentState <= 0.0) || (dotP > 0.0 && currentState < 0.0))
24 if (Math.AbsFloat(doorComponent.GetControlValue()) > 0.5)
28 doorComponent.SetActionInstigator(pUserEntity);
29 doorComponent.SetControlValue(controlValue);
32 super.PerformAction(pOwnerEntity, pUserEntity);
36 override bool CanBePerformedScript(IEntity user)
46 override bool GetActionNameScript(out
string outName)
48 auto doorComponent = GetDoorComponent();
50 if (doorComponent && Math.AbsFloat(doorComponent.GetControlValue()) >= 0.5)
51 outName =
"#AR-UserAction_Close";
53 outName =
"#AR-UserAction_Open";
62 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
64 super.PerformAction(pOwnerEntity, pUserEntity);
68 LadderComponent ladder = LadderComponent.Cast(door.FindComponent(LadderComponent));
71 if (door.GetControlValue() < 0.5)
73 ladder.SetEnabledEntry(
false);
77 ladder.SetEnabledEntry(
true);