DayZ 1.24
Loading...
Searching...
No Matches
ActionToggleTentOpen.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_Text = "#toggle_opening";
7 }
8
14
15 override bool IsUsingProxies()
16 {
17 return true;
18 }
19
20 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
21 {
22 Object targetObject = target.GetObject();
23 Object targetParent = target.GetParent();
24
26 {
27 if (targetParent.IsInherited(TentBase))
28 {
30 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
32
33 for (int s = 0; s < selections.Count(); s++)
34 {
35 if (tent.CanToggleAnimations(selections[s]))
36 {
37 //Print("nazov selekcie: " + selections[s]);
38 return true;
39 }
40 }
41 }
42 }
43
44 return false;
45 }
46
48 {
49 Object targetObject = action_data.m_Target.GetObject();
50 Object targetParent = action_data.m_Target.GetParent();
51
52 if (targetParent && targetParent.IsInherited(TentBase))
53 {
55 targetObject.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
56
58 for (int s = 0; s < selections.Count(); s++)
59 {
60 if (tent.CanToggleAnimations(selections[s]))
61 tent.ToggleAnimation(selections[s]);
62 }
63
64 //regenerate pathgraph
65 tent.SetAffectPathgraph(true, false);
66
67 if (tent.CanAffectPathgraph())
68 {
69 //Start update
70 tent.RegenerateNavmesh();
71 }
72 }
73 }
74
76 {
77 Object target_object = action_data.m_Target.GetObject();
79 if (ntarget)
80 ntarget.SoundSynchRemoteReset();
81 }
82};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
override bool IsUsingProxies()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnEndServer(ActionData action_data)
override void OnExecuteServer(ActionData action_data)
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597