DayZ 1.24
Loading...
Searching...
No Matches
ActionAnimateCarSelection.c
Go to the documentation of this file.
2{
3 string m_AnimSource = "";
4
6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_ALL;
9 m_Text = "#manipulate";
10 }
11
13 {
16 }
17
18 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
19 {
20 if (!target)
21 return false;
22
24 return false;
25
26 Object targetObject = target.GetObject();
28
30 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
31
34 {
35 for (int i = 0; i < selections.Count(); i++)
36 {
37 m_AnimSource = car.GetAnimSourceFromSelection(selections[i]);
38 if (m_AnimSource != "")
39 return true;
40 }
41 }
42
43 return false;
44 }
45
47 {
49 if (Class.CastTo(targetEnt, action_data.m_Target.GetObject()))
50 {
51 if (targetEnt.GetAnimationPhase(m_AnimSource) > 0.5)
52 targetEnt.SetAnimationPhase(m_AnimSource, 0.0);
53
54 if (targetEnt.GetAnimationPhase(m_AnimSource) <= 0.5)
55 targetEnt.SetAnimationPhase(m_AnimSource, 1.0);
56 }
57
59 if (Class.CastTo(car, action_data.m_Target.GetObject()))
60 car.ForceUpdateLightsStart();
61 }
62
64 {
66 if (Class.CastTo(car, action_data.m_Target.GetObject()))
67 car.ForceUpdateLightsEnd();
68 }
69};
string m_Text
Definition ActionBase.c:49
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:856
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
override void OnStartServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnEndServer(ActionData action_data)
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Camera.c:2
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.