DayZ
1.24
Loading...
Searching...
No Matches
CASingleUseQuantityEdible.c
Go to the documentation of this file.
1
class
CASingleUseQuantityEdible
:
CASingleUseQuantity
2
{
3
void
CASingleUseQuantityEdible
(
float
quantity_used_per_action
)
4
{
5
m_QuantityUsedPerAction
=
quantity_used_per_action
;
6
}
7
8
override
void
CalcAndSetQuantity
(
ActionData
action_data
)
9
{
10
if
(
m_SpentUnits
)
11
{
12
m_SpentUnits
.param1 =
m_QuantityUsedPerAction
;
13
SetACData
(
m_SpentUnits
);
14
}
15
16
PlayerBase
ntarget
=
PlayerBase
.Cast(
action_data
.m_Target.GetObject());
17
if
(
ntarget
)
18
{
19
if
(
GetGame
().IsServer())
20
{
21
//action_data.m_MainItem.Consume(ntarget, m_QuantityUsedPerAction);
22
ntarget
.Consume(
action_data
.m_MainItem,
m_QuantityUsedPerAction
,
EConsumeType
.ITEM_SINGLE_TIME);
23
}
24
}
25
else
26
{
27
if
(
GetGame
().IsServer())
28
{
29
//action_data.m_MainItem.Consume(action_data.m_Player, m_QuantityUsedPerAction);
30
action_data
.m_Player.Consume(
action_data
.m_MainItem,
m_QuantityUsedPerAction
,
EConsumeType
.ITEM_SINGLE_TIME);
31
}
32
}
33
}
34
};
EConsumeType
EConsumeType
Definition
EConsumeType.c:2
ActionData
Definition
ActionBase.c:21
CABase::SetACData
void SetACData(Param units)
Definition
CABase.c:38
CASingleUseQuantityEdible
Definition
CASingleUseQuantityEdible.c:2
CASingleUseQuantityEdible::CalcAndSetQuantity
override void CalcAndSetQuantity(ActionData action_data)
Definition
CASingleUseQuantityEdible.c:8
CASingleUseQuantityEdible::CASingleUseQuantityEdible
void CASingleUseQuantityEdible(float quantity_used_per_action)
Definition
CASingleUseQuantityEdible.c:3
CASingleUseQuantity
Definition
CASingleUseQuantity.c:2
CASingleUseQuantity::m_SpentUnits
ref Param1< float > m_SpentUnits
Definition
CASingleUseQuantity.c:5
CASingleUseQuantity::m_QuantityUsedPerAction
float m_QuantityUsedPerAction
Definition
CASingleUseQuantity.c:3
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
GetGame
proto native CGame GetGame()
scripts
4_World
Classes
UserActionsComponent
ActionComponents
CASingleUseQuantityEdible.c
Generated by
1.10.0