Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionclosefence.c
Go to the documentation of this file.
1
class
ActionCloseFence
:
ActionInteractBase
2
{
3
ref
NoiseParams
m_NoisePar
;
4
const
string
SELECTION_INTERACT
=
"gate_interact"
;
5
6
void
ActionCloseFence
()
7
{
8
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENDOORFW;
9
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT;
10
m_Text
=
"#close"
;
11
}
12
13
override
void
CreateConditionComponents
()
14
{
15
m_ConditionItem
=
new
CCINone
;
16
m_ConditionTarget
=
new
CCTCursor
;
17
}
18
19
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
20
{
21
Object
targetObject = target.GetObject();
22
if
( targetObject && targetObject.CanUseConstruction() )
23
{
24
Fence fence = Fence.Cast( targetObject );
25
26
if
( fence && fence.CanCloseFence() )
27
{
28
array<string>
selections =
new
array<string>
;
29
targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
30
31
for
(
int
i = 0; i < selections.Count(); i++ )
32
{
33
if
( selections[i] ==
SELECTION_INTERACT
)
34
return
true
;
35
}
36
}
37
}
38
39
return
false
;
40
}
41
42
override
void
OnStartServer
(
ActionData
action_data )
43
{
44
super.OnStartServer(action_data);
45
46
Fence fence = Fence.Cast( action_data.m_Target.GetObject() );
47
fence.CloseFence();
48
}
49
50
override
void
OnEndServer
(
ActionData
action_data )
51
{
52
super.OnEndServer(action_data);
53
54
m_NoisePar
=
new
NoiseParams
();
55
m_NoisePar
.LoadFromPath(
"CfgVehicles SurvivorBase NoiseActionDefault"
);
56
NoiseSystem
noise =
g_Game
.GetNoiseSystem();
57
if
( noise )
58
{
59
if
( action_data.m_Player )
60
noise.
AddNoisePos
(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(),
m_NoisePar
,
NoiseAIEvaluate
.
GetNoiseReduction
(
g_Game
.GetWeather()));
61
}
62
}
63
}
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionCloseFence::OnEndServer
override void OnEndServer(ActionData action_data)
Definition
actionclosefence.c:50
ActionCloseFence::ActionCloseFence
void ActionCloseFence()
Definition
actionclosefence.c:6
ActionCloseFence::SELECTION_INTERACT
const string SELECTION_INTERACT
Definition
actionclosefence.c:4
ActionCloseFence::m_NoisePar
ref NoiseParams m_NoisePar
Definition
actionclosefence.c:3
ActionCloseFence::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionclosefence.c:13
ActionCloseFence::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionclosefence.c:19
ActionCloseFence::OnStartServer
override void OnStartServer(ActionData action_data)
Definition
actionclosefence.c:42
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
CCINone
Definition
ccinone.c:2
CCTCursor
Definition
cctcursor.c:2
ItemBase
Definition
inventoryitem.c:742
NoiseAIEvaluate
Definition
sensesaievaluate.c:2
NoiseAIEvaluate::GetNoiseReduction
static float GetNoiseReduction(Weather weather)
Definition
sensesaievaluate.c:18
NoiseSystem
Definition
noise.c:2
NoiseSystem::AddNoisePos
proto void AddNoisePos(EntityAI source_entity, vector pos, NoiseParams noise_params, float external_strenght_multiplier=1.0)
Object
Definition
objecttyped.c:2
PlayerBase
Definition
playerbaseclient.c:2
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
NoiseParams
class NoiseSystem NoiseParams()
Definition
noise.c:15
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionclosefence.c
Generated by
1.17.0