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

Защищенные члены

void ActionCarDoors ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
override bool CanBeUsedInVehicle ()
 
void FillCommandUIDPerCrewIdx (int crewIdx0, int crewIdx1, int crewIdx2, int crewIdx3)
 
void FillCommandUIDPerCrewIdx (int evenCrewIdx0, int unevenCrewIdx1)
 

Защищенные данные

int m_CommandUIDPerCrewIdx [4]
 
bool m_IsOpening = true
 
CarScript m_Car = null
 
string m_AnimSource = ""
 

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

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

◆ ActionCarDoors()

void ActionCarDoors ( )
inlineprotected
11 {
12 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
13 m_StanceMask = DayZPlayerConstants.STANCEMASK_ALL;
14 m_LockTargetOnUse = false;
15 }
bool m_LockTargetOnUse
Definition ActionBase.c:60
int m_StanceMask
Definition ActionBase.c:62
int m_CommandUID
Definition AnimatedActionBase.c:143
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CommandUID, ActionBase::m_LockTargetOnUse и ActionBase::m_StanceMask.

Методы

◆ ActionCondition()

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

player inside vehicle

crewIdx sanity checks and see if there is a door

see if door is in reach

24 {
26 string animSource = "";
27
29 if (player && player.GetCommand_Vehicle())
30 {
31 if (Class.CastTo(car, player.GetCommand_Vehicle().GetTransport()))
32 {
33 int crewIdx = car.CrewMemberIndex(player);
34
36 if (crewIdx < 0 || crewIdx > 3 || car.GetCarDoorsState(car.GetDoorInvSlotNameFromSeatPos(crewIdx)) == CarDoorState.DOORS_MISSING)
37 {
38 return false;
39 }
40
41 animSource = car.GetAnimSourceFromSelection(car.GetDoorSelectionNameFromSeatPos(crewIdx));
42
44 if (!car.CanReachDoorsFromSeat(animSource, crewIdx) || !car.IsAreaAtDoorFree(crewIdx))
45 {
46 return false;
47 }
48
50
51 float animationPhaseInside = car.GetAnimationPhase(animSource);
52 return (m_IsOpening && animationPhaseInside <= 0.5) || (!m_IsOpening && animationPhaseInside > 0.5);
53 }
54 }
55
56 return false;
57 }
CarDoorState
Definition CarScript.c:2
int m_CommandUIDPerCrewIdx[4]
Definition ActionCarDoors.c:3
bool m_IsOpening
Definition ActionCarDoors.c:4
Definition CivilianSedan.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EntityAI.c:95
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), AnimatedActionBase::m_CommandUID, m_CommandUIDPerCrewIdx и m_IsOpening.

◆ CanBeUsedInVehicle()

override bool CanBeUsedInVehicle ( )
inlineprotected
121 {
122 return true;
123 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprotected
18 {
21 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.c:2
Definition CCTNone.c:2

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

◆ FillCommandUIDPerCrewIdx() [1/2]

void FillCommandUIDPerCrewIdx ( int crewIdx0,
int crewIdx1,
int crewIdx2,
int crewIdx3 )
inlineprotected

◆ FillCommandUIDPerCrewIdx() [2/2]

void FillCommandUIDPerCrewIdx ( int evenCrewIdx0,
int unevenCrewIdx1 )
inlineprotected
134 {
136 }
void FillCommandUIDPerCrewIdx(int crewIdx0, int crewIdx1, int crewIdx2, int crewIdx3)
Definition ActionCarDoors.c:125

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

◆ OnEnd()

override void OnEnd ( ActionData action_data)
inlineprotected
113 {
114 if (m_Car || m_AnimSource.Length() > 0)
115 {
116 Error("[WARNING] m_Car and m_AnimSource are left for backwards compatibility to not crash mods that are using it, but should no longer be used.");
117 }
118 }
string m_AnimSource
Definition ActionCarDoors.c:7
CarScript m_Car
Definition ActionCarDoors.c:6
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
proto native int Length()
Returns length of string.

Перекрестные ссылки Error(), string::Length(), m_AnimSource и m_Car.

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprotected
96 {
97 super.OnEndServer(action_data);
98
100 PlayerBase player = action_data.m_Player;
101 if (player && player.GetCommand_Vehicle())
102 {
103 car = CarScript.Cast(player.GetCommand_Vehicle().GetTransport());
104 }
105
106 if (car)
107 {
108 car.ForceUpdateLightsEnd();
109 }
110 }
Definition PlayerBaseClient.c:2

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
inlineprotected
60 {
61 super.OnStartServer(action_data);
62
63 PlayerBase player = action_data.m_Player;
64
65 float phase;
66 if (m_IsOpening)
67 {
68 phase = 1.0;
69 }
70 else
71 {
72 phase = 0.0;
73 }
74
75 string animSource = "";
76
78 if (player && player.GetCommand_Vehicle())
79 {
80 car = CarScript.Cast(player.GetCommand_Vehicle().GetTransport());
81 if (car)
82 {
83 int crewIdx = car.CrewMemberIndex(player);
84 animSource = car.GetAnimSourceFromSelection(car.GetDoorSelectionNameFromSeatPos(crewIdx));
85 }
86 }
87
88 if (car)
89 {
90 car.ForceUpdateLightsStart();
91 car.SetAnimationPhase(animSource, phase);
92 }
93 }

Перекрестные ссылки m_IsOpening.

Поля

◆ m_AnimSource

string m_AnimSource = ""
protected

Используется в OnEnd().

◆ m_Car

CarScript m_Car = null
protected

Используется в OnEnd().

◆ m_CommandUIDPerCrewIdx

int m_CommandUIDPerCrewIdx[4]
protected

Используется в ActionCondition() и FillCommandUIDPerCrewIdx().

◆ m_IsOpening


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