Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionpacktent.c
Go to the documentation of this file.
1
class
ActionPackTentCB
:
ActionContinuousBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
m_ActionData
.m_ActionComponent =
new
CAContinuousTime
(
UATimeSpent
.
DEFAULT_DEPLOY
);
//Use same time as Deploy
6
}
7
}
8
9
class
ActionPackTent
:
ActionContinuousBase
10
{
11
void
ActionPackTent
()
12
{
13
m_CallbackClass =
ActionPackTentCB
;
14
m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
15
m_CommandUID
= 0;
16
m_FullBody =
true
;
17
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT;
18
m_Text =
"#pack_tent"
;
19
}
20
21
override
void
CreateConditionComponents
()
22
{
23
m_ConditionItem =
new
CCINone
;
24
m_ConditionTarget =
new
CCTCursorParent
(
UAMaxDistances
.
DEFAULT
);
25
}
26
27
override
typename
GetInputType
()
28
{
29
return
ContinuousInteractActionInput
;
30
}
31
32
override
bool
IsUsingProxies
()
33
{
34
return
true
;
35
}
36
37
override
bool
HasProgress
()
38
{
39
return
true
;
40
}
41
42
override
bool
HasAlternativeInterrupt
()
43
{
44
return
true
;
45
}
46
47
override
bool
UseMainItem
()
48
{
49
return
false
;
50
}
51
52
override
bool
ActionConditionContinue
(
ActionData
action_data )
53
{
54
Object
targetParent = action_data.m_Target.GetParent();
55
TentBase
tent =
TentBase
.Cast( targetParent );
56
return
tent.CanBePacked();
57
}
58
59
override
ActionData
CreateActionData
()
60
{
61
PlaceObjectActionData
action_data =
new
PlaceObjectActionData
;
62
return
action_data;
63
}
64
65
override
bool
SetupAction
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item, out
ActionData
action_data,
Param
extra_data = NULL)
66
{
67
if
( super.SetupAction(player, target, item, action_data, extra_data ))
68
{
69
PlaceObjectActionData
poActionData;
70
poActionData =
PlaceObjectActionData
.Cast(action_data);
71
poActionData.
m_AlreadyPlaced
=
false
;
72
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONFB_DEPLOY_2HD;
//Call the animation
73
return
true
;
74
}
75
return
false
;
76
}
77
78
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
79
{
80
Object
targetObject = target.GetObject();
81
Object
targetParent = target.GetParent();
82
83
TentBase
inventory_tent =
TentBase
.Cast(targetObject);
84
if
(inventory_tent && inventory_tent.GetHierarchyRootPlayer())
85
{
86
return
false
;
//tent is somewhere in player's inventory
87
}
88
89
if
( player && targetObject && targetParent )
90
{
91
TentBase
tent =
TentBase
.Cast( targetParent );
92
if
( tent.CanBePacked() )
93
{
94
array<string>
selections =
new
array<string>
;
95
targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
96
97
for
(
int
s = 0; s < selections.Count(); s++ )
98
{
99
if
( selections[s] ==
"pack"
)
100
{
101
return
true
;
102
}
103
}
104
}
105
}
106
return
false
;
107
}
108
109
override
void
Start
(
ActionData
action_data )
//Setup on start of action
110
{
111
super.Start(action_data);
112
113
if
( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(
true
);
114
}
115
116
override
void
OnExecute
(
ActionData
action_data )
117
{
118
Object
targetParent = action_data.m_Target.GetParent();
119
TentBase
tent =
TentBase
.Cast( targetParent );
120
tent.SetIsBeingPacked(
true
);
121
}
122
123
override
void
OnEnd
(
ActionData
action_data )
124
{
125
Object
targetParent = action_data.m_Target.GetParent();
126
TentBase
tent =
TentBase
.Cast( targetParent );
127
tent.SetIsBeingPacked(
false
);
128
if
( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(
false
);
129
}
130
131
override
void
OnFinishProgressServer
(
ActionData
action_data )
132
{
133
//vector offset = Vector(1, 0, 0);
134
Object
targetParent = action_data.m_Target.GetParent();
135
TentBase
tent =
TentBase
.Cast( targetParent );
136
if
(tent.CanBePacked())
137
tent.Pack(
true
);
138
}
139
140
override
string
GetAdminLogMessage
(
ActionData
action_data)
141
{
142
return
" packed "
+ action_data.m_Target.GetParent().GetDisplayName() +
" with Hands "
;
143
}
144
};
m_CommandUID
int m_CommandUID
Definition
actionbase.c:31
m_StanceMask
int m_StanceMask
Definition
actionbase.c:33
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionPackTent
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
Definition
actionpacktent.c:11
ActionTarget
class ActionTargets ActionTarget
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
animatedactionbase.c:3
ActionBase::CreateActionData
ActionData CreateActionData()
Definition
actionbase.c:231
ActionBase::CreateConditionComponents
void CreateConditionComponents()
Definition
actionbase.c:236
ActionBase::IsUsingProxies
bool IsUsingProxies()
not using plane object - it's using multiple proxies
Definition
actionbase.c:274
ActionBase::SetupAction
bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
Definition
actionbase.c:162
ActionBase::UseMainItem
bool UseMainItem()
Definition
actionbase.c:391
ActionBase::GetAdminLogMessage
string GetAdminLogMessage(ActionData action_data)
Definition
actionbase.c:1340
ActionBase::HasProgress
bool HasProgress()
For UI: hiding of progress bar.
Definition
actionbase.c:256
ActionContinuousBaseCB
Definition
actioncontinuousbase.c:2
ActionContinuousBase
Definition
actioncontinuousbase.c:121
ActionContinuousBase::OnFinishProgressServer
void OnFinishProgressServer(ActionData action_data)
Definition
actioncontinuousbase.c:283
ActionContinuousBase::HasAlternativeInterrupt
bool HasAlternativeInterrupt()
Definition
actioncontinuousbase.c:147
ActionContinuousBase::GetInputType
override GetInputType()
Definition
actioncontinuousbase.c:179
ActionPackTentCB
Definition
actionpacktent.c:2
ActionPackTentCB::CreateActionComponent
override void CreateActionComponent()
Definition
actionpacktent.c:3
AnimatedActionBase::ActionConditionContinue
override bool ActionConditionContinue(ActionData action_data)
Definition
animatedactionbase.c:235
AnimatedActionBase::OnExecute
void OnExecute(ActionData action_data)
Definition
animatedactionbase.c:171
AnimatedActionBase::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
animatedactionbase.c:240
CAContinuousTime
Definition
cacontinuoustime.c:2
CCINone
Definition
ccinone.c:2
CCTCursorParent
Definition
cctcursorparent.c:2
ContinuousInteractActionInput
Definition
actioninput.c:523
ItemBase
Definition
inventoryitem.c:742
Object
Definition
objecttyped.c:2
Param
Base Param Class with no parameters.
Definition
param.c:12
PlaceObjectActionData
Definition
actiondeploybase.c:2
PlaceObjectActionData::m_AlreadyPlaced
bool m_AlreadyPlaced
Definition
actiondeploybase.c:5
PlayerBase
Definition
playerbaseclient.c:2
TentBase
Definition
cartent.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
actionconstants.c:112
UATimeSpent
Definition
actionconstants.c:28
UATimeSpent::DEFAULT_DEPLOY
const float DEFAULT_DEPLOY
Definition
actionconstants.c:38
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Start
void Start()
Plays all elements this effects consists of.
Definition
effect.c:157
OnEnd
void OnEnd()
Definition
sound.c:226
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionpacktent.c
Generated by
1.17.0