Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
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
};
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_SpecialtyWeight
float m_SpecialtyWeight
Definition
actionbase.c:83
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionRepairWithToolFromHands::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionrepairwithtoolfromhands.c:29
ActionRepairWithToolFromHands::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionrepairwithtoolfromhands.c:10
ActionRepairWithToolFromHands::ActionRepairWithToolFromHands
void ActionRepairWithToolFromHands()
Definition
actionrepairwithtoolfromhands.c:4
ActionRepairWithToolFromHands::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionrepairwithtoolfromhands.c:16
ActionSingleUseBase::ActionSingleUseBase
void ActionSingleUseBase()
Definition
actionsingleusebase.c:31
CCINonRuined
Definition
ccinonruined.c:2
CCTNonRuined
Definition
cctnonruined.c:2
ItemBase
Definition
inventoryitem.c:742
Object
Definition
objecttyped.c:2
PlayerBase
Definition
playerbaseclient.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
actionconstants.c:112
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
singleuse
actionrepairwithtoolfromhands.c
Generated by
1.17.0