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

Go to the source code of this file.

Classes

class  ActionLightItemOnFireWithBlowtorchCB
 

Functions

ActionLightItemOnFireWithBlowtorchCB ActionLightItemOnFireCB ActionLightItemOnFireWithBlowtorch ()
 
override void CreateActionComponent ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnUpdateServer (ActionData action_data)
 
override void OnExecuteServer (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 16 of file ActionLightItemOnFireWithBlowtorch.c.

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 }
bool IsItemInCargoOfSomething(ItemBase item)
const float FIREPLACE_IGNITE

References UATimeSpent::FIREPLACE_IGNITE, and IsItemInCargoOfSomething().

◆ ActionLightItemOnFireWithBlowtorch()

◆ CreateActionComponent()

override void ActionLightItemOnFireWithBlowtorch::CreateActionComponent ( )

Definition at line 12 of file ActionLightItemOnFireWithBlowtorch.c.

12 {
14 }
15

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)

Definition at line 72 of file ActionLightItemOnFireWithBlowtorch.c.

73 {
74 super.OnEndServer(action_data);
75
76 action_data.m_MainItem.GetCompEM().SwitchOff();
77 }

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)

Definition at line 58 of file ActionLightItemOnFireWithBlowtorch.c.

59 {
60 super.OnExecuteServer(action_data);
61
62 action_data.m_MainItem.GetCompEM().SwitchOn();
63 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 65 of file ActionLightItemOnFireWithBlowtorch.c.

66 {
67 super.OnFinishProgressServer(action_data);
68
69 action_data.m_MainItem.GetCompEM().SwitchOff();
70 }

◆ OnUpdateServer()

override void OnUpdateServer ( ActionData action_data)

Definition at line 50 of file ActionLightItemOnFireWithBlowtorch.c.

51 {
52 super.OnUpdate(action_data);
53
54 if (action_data.m_State == UA_PROCESSING && !action_data.m_MainItem.GetCompEM().IsWorking())
56 }
void Interrupt()
const int UA_PROCESSING
Definition constants.c:434

References Interrupt(), and UA_PROCESSING.