DayZ
1.24
Loading...
Searching...
No Matches
ActionConsume.c
Go to the documentation of this file.
1
class
ActionConsumeCB
:
ActionContinuousBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
m_ActionData
.
m_ActionComponent
=
new
CAContinuousQuantityEdible
(
UAQuantityConsumed
.
DEFAULT
,
UATimeSpent
.
DEFAULT
);
6
}
7
};
8
9
class
ActionConsume
:
ActionContinuousBase
10
{
11
void
ActionConsume
()
12
{
13
m_CallbackClass
=
ActionConsumeCB
;
14
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_EAT;
15
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_EAT;
16
17
m_Text
=
"#eat"
;
18
}
19
20
override
bool
HasProneException
()
21
{
22
return
true
;
23
}
24
25
override
bool
HasTarget
()
26
{
27
return
false
;
28
}
29
30
override
void
CreateConditionComponents
()
31
{
32
m_ConditionItem
=
new
CCINotRuinedAndEmpty
();
33
m_ConditionTarget
=
new
CCTSelf
();
34
}
35
36
override
void
OnEndServer
(
ActionData
action_data
)
37
{
38
ItemBase
item
=
action_data
.m_MainItem;
39
40
if
(
item
&&
item
.GetQuantity() <= 0.01)
41
item
.SetQuantity(0);
42
else
if
(
item
&&
GetProgress
(
action_data
) > 0)
43
{
44
// we don't want to inject an agent into an empty container
45
PlayerBase
player
=
action_data
.m_Player;
46
PluginTransmissionAgents
plugin
= PluginTransmissionAgents.Cast(
GetPlugin
(PluginTransmissionAgents));
47
plugin
.TransmitAgents(
player
,
item
,
AGT_UACTION_TO_ITEM
);
48
}
49
}
50
};
m_Text
string m_Text
Definition
ActionBase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition
ActionBase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
ActionBase.c:56
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition
PluginManager.c:300
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
AnimatedActionBase.c:3
ActionConsumeCB
Definition
ActionConsume.c:2
ActionConsumeCB::CreateActionComponent
override void CreateActionComponent()
Definition
ActionConsume.c:3
ActionConsume
Definition
ActionConsume.c:10
ActionConsume::ActionConsume
void ActionConsume()
Definition
ActionConsume.c:11
ActionConsume::OnEndServer
override void OnEndServer(ActionData action_data)
Definition
ActionConsume.c:36
ActionConsume::HasTarget
override bool HasTarget()
Definition
ActionConsume.c:25
ActionConsume::HasProneException
override bool HasProneException()
Definition
ActionConsume.c:20
ActionConsume::CreateConditionComponents
override void CreateConditionComponents()
Definition
ActionConsume.c:30
ActionContinuousBaseCB
Definition
ActionContinuousBase.c:2
ActionContinuousBase
Definition
ActionContinuousBase.c:119
ActionData
Definition
ActionBase.c:21
ActionData::m_ActionComponent
ref CABase m_ActionComponent
Definition
ActionBase.c:30
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
AnimatedActionBase.c:122
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Definition
AnimatedActionBase.c:124
AnimatedActionBase::GetProgress
override float GetProgress(ActionData action_data)
Definition
AnimatedActionBase.c:365
AnimatedActionBase::m_CommandUIDProne
int m_CommandUIDProne
Definition
AnimatedActionBase.c:123
CAContinuousQuantityEdible
Definition
CAContinuousQuantityEdible.c:2
CCINotRuinedAndEmpty
Definition
CCINotRuinedAndEmpty.c:2
CCTSelf
Definition
CCTSelf.c:2
ItemBase
Definition
InventoryItem.c:697
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
UAQuantityConsumed
Definition
ActionConstants.c:4
UAQuantityConsumed::DEFAULT
const float DEFAULT
Definition
ActionConstants.c:5
UATimeSpent
Definition
ActionConstants.c:27
UATimeSpent::DEFAULT
const float DEFAULT
Definition
ActionConstants.c:28
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:597
AGT_UACTION_TO_ITEM
const int AGT_UACTION_TO_ITEM
Definition
constants.c:474
scripts
4_World
Classes
UserActionsComponent
Actions
Continuous
ActionConsume.c
Generated by
1.10.0