DayZ
1.24
Loading...
Searching...
No Matches
ActionRepairWithToolFromHands.c
Go to the documentation of this file.
1
// This is just a test action!
2
class
ActionRepairWithToolFromHands
:
ActionSingleUseBase
3
{
4
void
ActionRepairWithToolFromHands
()
5
{
6
m_SpecialtyWeight
=
UASoftSkillsWeight
.
PRECISE_HIGH
;
7
m_Text
=
"#repair"
;
8
}
9
10
override
void
CreateConditionComponents
()
11
{
12
m_ConditionItem
=
new
CCINonRuined
;
13
m_ConditionTarget
=
new
CCTNonRuined
(
UAMaxDistances
.
DEFAULT
);
14
}
15
16
override
bool
ActionCondition
(
PlayerBase
player
, ActionTarget
target
,
ItemBase
item
)
17
{
18
Object
targetObject
=
target
.GetObject();
19
if
(
targetObject
/*&& targetObject.IsKindOf("ItemBase")*/
)
20
{
21
ItemBase
item_to_repair
=
ItemBase
.Cast(
targetObject
);
22
bool
can_repair
=
item_to_repair
.CanRepair(
item
);
23
return
can_repair
;
24
}
25
26
return
false
;
27
}
28
29
override
void
OnExecuteServer
(
ActionData
action_data
)
30
{
31
Object
targetObject
=
action_data
.m_Target.GetObject();
32
if
(
targetObject
/* && targetObject.IsKindOf("ItemBase")*/
)
33
{
34
ItemBase
item_to_repair
=
ItemBase
.Cast(
targetObject
);
35
Param1<float>
nacdata
=
Param1<float>
.Cast(
action_data
.m_ActionComponent.GetACData());
36
bool
was_repaired
=
item_to_repair
.Repair(
action_data
.m_Player,
action_data
.m_MainItem,
nacdata
.param1);
37
}
38
39
action_data
.m_Player.GetSoftSkillsManager().AddSpecialty(
m_SpecialtyWeight
);
40
}
41
};
m_Text
string m_Text
Definition
ActionBase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition
ActionBase.c:55
m_SpecialtyWeight
float m_SpecialtyWeight
Definition
ActionBase.c:68
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
ActionBase.c:56
ActionData
Definition
ActionBase.c:21
ActionRepairWithToolFromHands
Definition
ActionRepairWithToolFromHands.c:3
ActionRepairWithToolFromHands::ActionRepairWithToolFromHands
void ActionRepairWithToolFromHands()
Definition
ActionRepairWithToolFromHands.c:4
ActionRepairWithToolFromHands::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
ActionRepairWithToolFromHands.c:29
ActionRepairWithToolFromHands::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionRepairWithToolFromHands.c:16
ActionRepairWithToolFromHands::CreateConditionComponents
override void CreateConditionComponents()
Definition
ActionRepairWithToolFromHands.c:10
ActionSingleUseBase
Definition
ActionSingleUseBase.c:40
CCINonRuined
Definition
CCINonRuined.c:2
CCTNonRuined
Definition
CCTNonRuined.c:2
ItemBase
Definition
InventoryItem.c:697
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
UAMaxDistances
Definition
ActionConstants.c:105
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
ActionConstants.c:107
UASoftSkillsWeight
Definition
ActionConstants.c:119
UASoftSkillsWeight::PRECISE_HIGH
const float PRECISE_HIGH
Definition
ActionConstants.c:125
scripts
4_World
Classes
UserActionsComponent
Actions
SingleUse
ActionRepairWithToolFromHands.c
Generated by
1.10.0