DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionAnimateSeats
+ Граф наследования:ActionAnimateSeats:

Закрытые члены

void ActionAnimateSeats ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBeUsedInVehicle ()
 
override bool AddActionJuncture (ActionData action_data)
 

Подробное описание

Конструктор(ы)

◆ ActionAnimateSeats()

void ActionAnimateSeats ( )
inlineprivate
4 {
5 m_Text = "#move_seat";
6 }
string m_Text
Definition ActionBase.c:58

Перекрестные ссылки ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
9 {
10 if( !target ) return false;
11 if( !IsInReach(player, target, UAMaxDistances.DEFAULT) ) return false;
12
13 Object targetObject = target.GetObject();
17 int crewIdx;
18
19 //string selection = targetObject.GetActionComponentName(target.GetComponentIndex());
21 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
22
23
25 return false;
26
27 if ( Class.CastTo(car, targetEnt) )
28 {
29 for (int i = 0; i < selections.Count(); i++)
30 {
31 m_AnimSource = car.GetAnimSourceFromSelection( selections[i]) ;
32 if ( m_AnimSource != "" )
33 {
34 //return true; //TODO:: NEED A LINK BETWEEN SeatBack and seat with crew after that we can REMOVE the return
35
36 HumanCommandVehicle vehCmd = player.GetCommand_Vehicle();
37
38 if ( m_AnimSource == "SeatDriver" )
39 {
40 if ( transport.CrewMember( DayZPlayerConstants.VEHICLESEAT_DRIVER ) )
41 return false;
42
43 if ( !vehCmd && car.GetCarDoorsState( "NivaDriverDoors" ) == CarDoorState.DOORS_CLOSED )
44 return false;
45 }
46
47 if ( m_AnimSource == "SeatCoDriver" )
48 {
49 if ( transport.CrewMember( DayZPlayerConstants.VEHICLESEAT_CODRIVER ) )
50 return false;
51
52 if ( !vehCmd && car.GetCarDoorsState( "NivaCoDriverDoors" ) == CarDoorState.DOORS_CLOSED )
53 return false;
54 }
55
56 if ( !vehCmd && !transport.CanReachSeatFromDoors(selections[i], player.GetPosition(), 1.0) )
57 return false;
58
59 return true;
60 }
61 }
62 }
63
64 return false;
65 }
CarDoorState
Definition CarScript.c:2
string m_AnimSource
Definition ActionAnimateCarSelection.c:3
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:1054
Definition CivilianSedan.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Camera.c:2
Definition human.c:690
Definition ObjectTyped.c:2
Definition EntityAI.c:95
Base native class for all motorized wheeled vehicles.
Definition Boat.c:28
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), UAMaxDistances::DEFAULT, ActionBase::IsInReach() и ActionAnimateCarSelection::m_AnimSource.

◆ AddActionJuncture()

override bool AddActionJuncture ( ActionData action_data)
inlineprivate
73 {
74 Transport trans = Transport.Cast(action_data.m_Target.GetObject());
75 bool accepted = false;
76 int nextSeat = trans.CrewPositionIndex( action_data.m_Target.GetComponentIndex() );
77 Transport transport = Transport.Cast(action_data.m_Target.GetObject());
79 if (transport)
80 {
81 il.SetVehicle(transport, action_data.m_Player, nextSeat);
82
83 //Lock target
84 if (GetGame().AddInventoryJunctureEx(action_data.m_Player, action_data.m_Player, il, true, 10000))
85 {
86 accepted = true;
87 action_data.m_ReservedInventoryLocations.Insert(il);
88 }
89 }
90
91 return accepted;
92 }
InventoryLocation.
Definition InventoryLocation.c:29
proto native CGame GetGame()

Перекрестные ссылки GetGame().

◆ CanBeUsedInVehicle()

override bool CanBeUsedInVehicle ( )
inlineprivate
68 {
69 return true;
70 }

Объявления и описания членов класса находятся в файле: