DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ActionLightItemOnFire.c

См. исходные тексты.

Структуры данных

class  ActionLightItemOnFireCB
 

Функции

ActionLightItemOnFireCB ActionContinuousBaseCB ActionLightItemOnFire ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool CanBePerformedFromQuickbar ()
 
bool IsItemInCargoOfSomething (ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
void SetIgnitingAnimation (ItemBase target_item)
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
71 {
72 ItemBase targetItem = ItemBase.Cast(target.GetObject());
73
74 if (targetItem && item)
75 {
76 // when igniting item on the ground with igniter in hands
77 if (!targetItem.IsIgnited() && !IsItemInCargoOfSomething(targetItem) && item.CanIgniteItem(targetItem) && targetItem.CanBeIgnitedBy(item))
78 {
79 // oven stage of standard fireplace
80 if (targetItem.IsKindOf("Fireplace"))
81 {
82 if (Fireplace.Cast(targetItem).IsOven())
83 return true;
84
85 if (Fireplace.CanIgniteEntityAsFireplace(targetItem))
86 return true;
87
88 return false;
89 }
90
91 return true;
92 }
93 // when igniting item in hands from something on ground
94 else if (!item.IsIgnited() && !IsItemInCargoOfSomething(item) && targetItem.CanIgniteItem(item) && item.CanBeIgnitedBy(targetItem))
95 {
96 return true;
97 }
98 }
99
100 return false;
101 }
bool IsItemInCargoOfSomething(ItemBase item)
Definition ActionLightItemOnFire.c:40
Definition InventoryItem.c:731
Definition EntityAI.c:95

Перекрестные ссылки IsItemInCargoOfSomething().

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
57 {
58 FireworksBase fireworks = FireworksBase.Cast( action_data.m_Target.GetObject() );
59
60 if (fireworks)
61 {
62 return true;//something might begin occluding the item after the ignition began, we don't want that to cancel the ignition process, not the prettiest solution, but it works
63 }
64 else
65 {
66 return ActionCondition(action_data.m_Player, action_data.m_Target,action_data.m_MainItem);
67 }
68 }
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionLightItemOnFire.c:70

Перекрестные ссылки AnimatedActionBase::ActionCondition().

◆ ActionLightItemOnFire()

12 {
13 m_CallbackClass = ActionLightItemOnFireCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_STARTFIRE;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
17
18 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
19 m_Text = "#ignite";
20 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition ActionLightItemOnFire.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Используется в ActionConstructor::RegisterActions(), SetActions(), ItemBase::SetActions(), Roadflare::SetActions() и FlammableBase::SetActions().

◆ CanBePerformedFromQuickbar()

override bool CanBePerformedFromQuickbar ( )
29 {
30 return true;
31 }

◆ CreateActionComponent()

override void CreateActionComponent ( )
12 {
13 m_CallbackClass = ActionLightItemOnFireCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_STARTFIRE;
15 m_FullBody = true;

Перекрестные ссылки m_CommandUID и m_StanceMask.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
23 {
24 m_ConditionTarget = new CCTNonRuined( UAMaxDistances.DEFAULT );
25 m_ConditionItem = new CCINonRuined;
26 }
Definition CCINonRuined.c:2
Definition CCTNonRuined.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

Перекрестные ссылки UAMaxDistances::DEFAULT.

◆ IsItemInCargoOfSomething()

bool IsItemInCargoOfSomething ( ItemBase item)
41 {
42 if ( item.GetInventory() )
43 {
45 item.GetInventory().GetCurrentInventoryLocation(loc);
46
47 if ( loc.GetIdx() > -1 )
48 {
49 return true;
50 }
51 }
52
53 return false;
54 }
InventoryLocation.
Definition InventoryLocation.c:29

Используется в ActionCondition().

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
104 {
105 ClearActionJuncture(action_data);
106 ItemBase target_item = ItemBase.Cast( action_data.m_Target.GetObject() );
107 ItemBase item = action_data.m_MainItem;
108
110 ItemBase ignited_item; //item that was lit on fire
111 ItemBase fire_source_item; //item that was the source of fire
112
113 if ( item.CanIgniteItem( target_item ) )
114 {
115 is_ignition_successful = target_item.IsThisIgnitionSuccessful( item );
118 }
119 else if ( item.CanBeIgnitedBy( target_item ) )
120 {
121 is_ignition_successful = target_item.IsTargetIgnitionSuccessful( item );
124 }
125
127 {
128 fire_source_item.OnIgnitedTarget( ignited_item );
129 ignited_item.OnIgnitedThis( fire_source_item );
130 }
131 else
132 {
133 fire_source_item.OnIgnitedTargetFailed( ignited_item );
134 ignited_item.OnIgnitedThisFailed( fire_source_item );
135 }
136 }

Перекрестные ссылки ActionBase::ClearActionJuncture().

◆ SetIgnitingAnimation()

void SetIgnitingAnimation ( ItemBase target_item)
156 {
157 if ( target_item.HasFlammableMaterial() )
158 {
159 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_STARTFIRE;
160 }
161 else
162 {
163 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
164 }
165 }

Перекрестные ссылки m_CommandUID.

Используется в SetupAction().

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
140 {
141 if ( super.SetupAction( player, target, item, action_data, extra_data ) )
142 {
143 ItemBase target_item = ItemBase.Cast( target.GetObject() );
144 if ( target_item )
145 {
147 }
148
149 return true;
150 }
151
152 return false;
153 }
void SetIgnitingAnimation(ItemBase target_item)
Definition ActionLightItemOnFire.c:155

Перекрестные ссылки SetIgnitingAnimation().