Dayz 1.25
Dayz Code 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:51
int m_StanceMask
Definition ActionBase.c:53
int m_CommandUID
Definition AnimatedActionBase.c:135
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CommandUID, m_LockTargetOnUse и 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
117 {
118 return true;
119 }

◆ CreateConditionComponents()

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

Перекрестные ссылки m_ConditionItem и 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
130 {
132 }
void FillCommandUIDPerCrewIdx(int crewIdx0, int crewIdx1, int crewIdx2, int crewIdx3)
Definition ActionCarDoors.c:121

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

◆ OnEnd()

override void OnEnd ( ActionData action_data)
inlineprotected
109 {
110 if (m_Car || m_AnimSource.Length() > 0)
111 {
112 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.");
113 }
114 }
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
94 {
96 PlayerBase player = action_data.m_Player;
97 if (player && player.GetCommand_Vehicle())
98 {
99 car = CarScript.Cast(player.GetCommand_Vehicle().GetTransport());
100 }
101
102 if (car)
103 {
104 car.ForceUpdateLightsEnd();
105 }
106 }
Definition PlayerBaseClient.c:2

◆ OnStartServer()

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

Перекрестные ссылки 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


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