3 const string m_sCannotPerformHostile =
"#AR-UserAction_SeatHostile";
4 const string m_sCannotPerformObstructed =
"#AR-UserAction_SeatObstructed";
7 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
12 BaseCompartmentSlot compartment = GetCompartmentSlot();
16 ChimeraCharacter casualty = ChimeraCharacter.Cast(compartment.GetOccupant());
20 CompartmentAccessComponent casualtyCompartmentAccess = casualty.GetCompartmentAccessComponent();
21 if (casualtyCompartmentAccess)
22 casualtyCompartmentAccess.EjectOutOfVehicle();
24 super.PerformAction(pOwnerEntity, pUserEntity);
28 override bool CanBePerformedScript(IEntity user)
30 BaseCompartmentSlot compartment = GetCompartmentSlot();
34 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(user);
38 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
39 if (!compartmentAccess)
43 BaseCompartmentSlot characterCompartment = compartmentAccess.GetCompartment();
44 if (characterCompartment && characterCompartment.GetCompartmentSection() != compartment.GetCompartmentSection())
47 IEntity owner = compartment.GetOwner();
48 Vehicle vehicle = Vehicle.Cast(owner.GetRootParent());
51 Faction characterFaction = character.GetFaction();
52 Faction vehicleFaction = vehicle.GetFaction();
54 if (characterFaction && vehicleFaction && characterFaction.IsFactionEnemy(vehicleFaction))
58 if (vehicleAffiliation)
59 isActive = vehicleAffiliation.IsVehicleActive();
63 SetCannotPerformReason(m_sCannotPerformHostile);
70 if (!character.IsInVehicle() && !compartmentAccess.CanGetInVehicleViaDoor(owner, compartment, GetRelevantDoorIndex(user)))
72 SetCannotPerformReason(m_sCannotPerformObstructed);
80 override bool CanBeShownScript(IEntity user)
82 BaseCompartmentSlot compartment = GetCompartmentSlot();
86 ChimeraCharacter character = ChimeraCharacter.Cast(user);
90 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
91 if (!compartmentAccess)
94 if (compartmentAccess.IsGettingIn() || compartmentAccess.IsGettingOut())
98 BaseCompartmentSlot characterCompartment = compartmentAccess.GetCompartment();
99 if (characterCompartment && characterCompartment.GetCompartmentSection() != compartment.GetCompartmentSection())
102 ChimeraCharacter casualty = ChimeraCharacter.Cast(compartment.GetOccupant());
106 CharacterControllerComponent controller = casualty.GetCharacterController();
114 override bool HasLocalEffectOnlyScript()