DayZ 1.24
Loading...
Searching...
No Matches
ActionLightItemOnFireWithBlowtorch.c
Go to the documentation of this file.
2{
7}
8
10{
12 {
14 }
15
16 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
17 {
18 Blowtorch bt = Blowtorch.Cast(item);
19 if (!bt.HasEnoughEnergyForRepair(UATimeSpent.FIREPLACE_IGNITE))
20 return false;
21
22 ItemBase target_item = ItemBase.Cast(target.GetObject());
23 if (target_item && item)
24 {
25 // when igniting item on the ground with igniter in hands
26 if (!target_item.IsIgnited() && !IsItemInCargoOfSomething(target_item) && target_item.CanBeIgnitedBy(item))
27 {
28 // oven stage of standard fireplace
29 if (target_item.IsKindOf("Fireplace"))
30 {
31 if (Fireplace.Cast(target_item).IsOven())
32 return true;
33
34 if (Fireplace.CanIgniteEntityAsFireplace(target_item))
35 return true;
36
37 return false;
38 }
39
40 return true;
41 }
42 // when igniting item in hands from something on ground
43 else if (!item.IsIgnited() && !IsItemInCargoOfSomething(item) && target_item.CanIgniteItem(item) && item.CanBeIgnitedBy(target_item))
44 return true;
45 }
46
47 return false;
48 }
49
51 {
52 super.OnUpdate(action_data);
53
54 if (action_data.m_State == UA_PROCESSING && !action_data.m_MainItem.GetCompEM().IsWorking())
56 }
57
59 {
60 super.OnExecuteServer(action_data);
61
62 action_data.m_MainItem.GetCompEM().SwitchOn();
63 }
64
66 {
67 super.OnFinishProgressServer(action_data);
68
69 action_data.m_MainItem.GetCompEM().SwitchOff();
70 }
71
73 {
74 super.OnEndServer(action_data);
75
76 action_data.m_MainItem.GetCompEM().SwitchOff();
77 }
78}
void OnUpdateServer(float deltatime, float blood_scale, bool no_blood_loss)
override void OnFinishProgressServer(ActionData action_data)
void OnEndServer(ActionData action_data)
Definition ActionBase.c:962
bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:350
override void OnExecuteServer(ActionData action_data)
bool IsItemInCargoOfSomething(ItemBase item)
ActionLightItemOnFireCB ActionContinuousBaseCB ActionLightItemOnFire()
ActionLightItemOnFireWithBlowtorchCB ActionLightItemOnFireCB ActionLightItemOnFireWithBlowtorch()
void Interrupt()
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
const float FIREPLACE_IGNITE
const int UA_PROCESSING
Definition constants.c:434