DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionCarDoorsOutside.c
См. документацию.
2{
3 protected int m_CommandUIDPerCrewIdx[4];
4 protected bool m_IsOpening = true;
5
7 {
8 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
9 m_StanceMask = DayZPlayerConstants.STANCEMASK_ALL;
10 m_LockTargetOnUse = false;
11 }
12
14 {
17 }
18
19 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
20 {
21 CarScript car = null;
22
24 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
25 {
26 return false;
27 }
28
30 if (Class.CastTo(car, target.GetParent()))
31 {
32 array<string> selections = new array<string>();
33
34 CarDoor carDoor = CarDoor.Cast(target.GetObject());
35 if (carDoor)
36 {
37 carDoor.GetActionComponentNameList(target.GetComponentIndex(), selections);
38
39 string animSource = "";
40
41 for (int i = 0; i < selections.Count(); i++)
42 {
43 animSource = car.GetAnimSourceFromSelection(selections[i]);
44 if (animSource != "")
45 {
46 int idx = car.GetSeatIndexFromDoor(animSource);
47 if (idx != -1 && !car.IsAreaAtDoorFreeDiag(idx))
48 {
49 return false;
50 }
51
53 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
54
55 float animationPhase = car.GetAnimationPhase(animSource);
57 return (m_IsOpening && animationPhase <= 0.5 ) || ( !m_IsOpening && animationPhase > 0.5);
58 }
59 }
60 }
61 }
62
63 return false;
64 }
65
66 override void OnStartServer( ActionData action_data )
67 {
68 super.OnStartServer(action_data);
69
70 float phase;
71
72 if (m_IsOpening)
73 {
74 phase = 1.0;
75 }
76 else
77 {
78 phase = 0.0;
79 }
80
81 string animSource = "";
82
83 CarScript car = CarScript.Cast(action_data.m_Target.GetParent());
84 if (car)
85 {
86 array<string> selections = new array<string>();
87 CarDoor carDoor = CarDoor.Cast(action_data.m_Target.GetObject());
88 if (carDoor)
89 {
90 carDoor.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
91 for (int i = 0; i < selections.Count(); i++)
92 {
93 animSource = car.GetAnimSourceFromSelection(selections[i]);
94 if (animSource != "")
95 {
96 break;
97 }
98 }
99 }
100 }
101
102 if (car)
103 {
104 car.SetAnimationPhase(animSource, phase);
105 }
106 }
107
108 override void OnEndServer(ActionData action_data)
109 {
110 super.OnEndServer(action_data);
111 }
112
113 //--------- Not used for this class
114 protected void FillCommandUIDPerCrewIdx(int crewIdx0, int crewIdx1, int crewIdx2, int crewIdx3)
115 {
116 m_CommandUIDPerCrewIdx[0] = crewIdx0;
117 m_CommandUIDPerCrewIdx[1] = crewIdx1;
118 m_CommandUIDPerCrewIdx[2] = crewIdx2;
119 m_CommandUIDPerCrewIdx[3] = crewIdx3;
120 }
121
122 protected void FillCommandUIDPerCrewIdx(int evenCrewIdx0, int unevenCrewIdx1)
123 {
124 FillCommandUIDPerCrewIdx(evenCrewIdx0, unevenCrewIdx1, evenCrewIdx0, unevenCrewIdx1);
125 }
126 //-----------------------------------
127};
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Определения ActionBase.c:1290
bool m_LockTargetOnUse
Определения ActionBase.c:59
ref CCIBase m_ConditionItem
Определения ActionBase.c:63
ref CCTBase m_ConditionTarget
Определения ActionBase.c:64
int m_StanceMask
Определения ActionBase.c:61
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:125
void FillCommandUIDPerCrewIdx(int crewIdx0, int crewIdx1, int crewIdx2, int crewIdx3)
Определения ActionCarDoorsOutside.c:114
int m_CommandUIDPerCrewIdx[4]
Определения ActionCarDoorsOutside.c:3
override void CreateConditionComponents()
Определения ActionCarDoorsOutside.c:13
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionCarDoorsOutside.c:19
void ActionCarDoorsOutside()
Определения ActionCarDoorsOutside.c:6
override void OnStartServer(ActionData action_data)
Определения ActionCarDoorsOutside.c:66
void FillCommandUIDPerCrewIdx(int evenCrewIdx0, int unevenCrewIdx1)
Определения ActionCarDoorsOutside.c:122
override void OnEndServer(ActionData action_data)
Определения ActionCarDoorsOutside.c:108
ref ActionTarget m_Target
Определения ActionBase.c:39
Определения ActionBase.c:22
void ActionInteractBase()
Определения ActionInteractBase.c:43
int m_CommandUID
Определения AnimatedActionBase.c:147
Определения CCINone.c:2
Определения CCTNone.c:2
override int GetSeatIndexFromDoor(string pDoorSelection)
Определения Truck_02.c:286
override string GetAnimSourceFromSelection(string selection)
Определения Truck_02.c:205
Определения Truck_02.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения PlayerBaseClient.c:2
const float DEFAULT
Определения ActionConstants.c:114
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.