Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionrepairwithtoolfromhands.c
Go to the documentation of this file.
1 // This is just a test action!
3 {
5  {
7  m_Text = "#repair";
8  }
9 
10  override void CreateConditionComponents()
11  {
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 };
ItemBase
Definition: inventoryitem.c:730
UASoftSkillsWeight
Definition: actionconstants.c:118
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
ActionRepairWithToolFromHands
Definition: actionrepairwithtoolfromhands.c:2