Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionrepairitemwithblowtorch.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.BASEBUILDING_REPAIR_MEDIUM);
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionRepairItemWithBlowtorchCB;
15 
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FLAME_REPAIR;
17  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
18  m_FullBody = true;
19  m_LockTargetOnUse = false;
20  m_Text = "#repair";
21  }
22 
23  override void CreateConditionComponents()
24  {
27  }
28 
29  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
30  {
31  PluginRepairing moduleRepairing;
32  Class.CastTo(moduleRepairing, GetPlugin(PluginRepairing));
33  Blowtorch bt = Blowtorch.Cast(item);
34 
35  return bt.HasEnoughEnergyForRepair(UATimeSpent.BASEBUILDING_REPAIR_MEDIUM) && moduleRepairing && moduleRepairing.CanRepair(item, target.GetObject());
36  }
37 
38  override void OnStartAnimationLoopServer(ActionData action_data)
39  {
40  super.OnStartAnimationLoopServer(action_data);
41 
42  action_data.m_MainItem.GetCompEM().SwitchOn();
43  }
44 
45  override void OnFinishProgressServer(ActionData action_data)
46  {
47  super.OnFinishProgressServer(action_data);
48 
49  ItemBase targetItem = ItemBase.Cast(action_data.m_Target.GetObject());
50  if (targetItem)
51  {
52  PluginRepairing moduleRepairing;
53  Class.CastTo(moduleRepairing, GetPlugin(PluginRepairing));
54  moduleRepairing.Repair(action_data.m_Player, action_data.m_MainItem, targetItem, m_SpecialtyWeight);
55  }
56 
57  action_data.m_MainItem.GetCompEM().SwitchOff();
58  }
59 
60  override void OnEndServer(ActionData action_data)
61  {
62  super.OnEndServer(action_data);
63 
64  action_data.m_MainItem.GetCompEM().SwitchOff();
65  }
66 }
ItemBase
Definition: inventoryitem.c:730
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionrepairitemwithblowtorch.c:45
CAContinuousTime
Definition: cacontinuoustime.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionrepairitemwithblowtorch.c:29
ActionRepairItemWithBlowtorch
ActionRepairItemWithBlowtorchCB ActionContinuousBaseCB ActionRepairItemWithBlowtorch()
Definition: actionrepairitemwithblowtorch.c:11
UAMaxDistances
Definition: actionconstants.c:104
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
OnEndServer
override void OnEndServer(ActionData action_data)
Definition: actionrepairitemwithblowtorch.c:60
ActionRepairItemWithBlowtorchCB
Definition: actionrepairitemwithblowtorch.c:1
CCTCursor
Definition: cctcursor.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_LockTargetOnUse
protected bool m_LockTargetOnUse
Definition: actionbase.c:51
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionrepairitemwithblowtorch.c:23
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
OnStartAnimationLoopServer
override void OnStartAnimationLoopServer(ActionData action_data)
Definition: actionrepairitemwithblowtorch.c:38
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53