DayZ 1.24
Loading...
Searching...
No Matches
ActionRepairItemWithBlowtorch.c File Reference

Go to the source code of this file.

Classes

class  ActionRepairItemWithBlowtorchCB
 

Functions

ActionRepairItemWithBlowtorchCB ActionContinuousBaseCB ActionRepairItemWithBlowtorch ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartAnimationLoopServer (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 

Function Documentation

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 29 of file ActionRepairItemWithBlowtorch.c.

30 {
33 Blowtorch bt = Blowtorch.Cast(item);
34
35 return bt.HasEnoughEnergyForRepair(UATimeSpent.BASEBUILDING_REPAIR_MEDIUM) && moduleRepairing && moduleRepairing.CanRepair(item, target.GetObject());
36 }
PluginBase GetPlugin(typename plugin_type)
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float BASEBUILDING_REPAIR_MEDIUM
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References UATimeSpent::BASEBUILDING_REPAIR_MEDIUM, Class::CastTo(), and GetPlugin().

◆ ActionRepairItemWithBlowtorch()

ActionRepairItemWithBlowtorchCB ActionContinuousBaseCB ActionRepairItemWithBlowtorch ( )

Definition at line 1 of file ActionRepairItemWithBlowtorch.c.

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 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
bool m_LockTargetOnUse
Definition ActionBase.c:51
float m_SpecialtyWeight
Definition ActionBase.c:68
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionConstructor::RegisterActions(), and ItemBase::SetActions().

◆ CreateActionComponent()

override void ActionRepairItemWithBlowtorch::CreateActionComponent ( )

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 23 of file ActionRepairItemWithBlowtorch.c.

24 {
27 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float REPAIR

References m_ConditionItem, m_ConditionTarget, and UAMaxDistances::REPAIR.

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)

Definition at line 60 of file ActionRepairItemWithBlowtorch.c.

61 {
62 super.OnEndServer(action_data);
63
64 action_data.m_MainItem.GetCompEM().SwitchOff();
65 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 45 of file ActionRepairItemWithBlowtorch.c.

46 {
47 super.OnFinishProgressServer(action_data);
48
49 ItemBase targetItem = ItemBase.Cast(action_data.m_Target.GetObject());
50 if (targetItem)
51 {
55 }
56
57 action_data.m_MainItem.GetCompEM().SwitchOff();
58 }

References Class::CastTo(), GetPlugin(), and m_SpecialtyWeight.

◆ OnStartAnimationLoopServer()

override void OnStartAnimationLoopServer ( ActionData action_data)

Definition at line 38 of file ActionRepairItemWithBlowtorch.c.

39 {
40 super.OnStartAnimationLoopServer(action_data);
41
42 action_data.m_MainItem.GetCompEM().SwitchOn();
43 }