DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionDismantleOven.c
См. документацию.
2{
3 override void CreateActionComponent()
4 {
6 }
7}
8
10{
12 {
13 m_CallbackClass = ActionDismantleOvenCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
17 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
18
19 m_Text = "#dismantle_oven";
20 }
21
23 {
24
25 m_ConditionTarget = new CCTNonRuined( UAMaxDistances.DEFAULT );
26 m_ConditionItem = new CCINotPresent;
27 }
28
29 override typename GetInputType()
30 {
32 }
33
34 /*override bool HasProgress()
35 {
36 return false;
37 }*/
38
39 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
40 {
41 //Action not allowed if player has broken legs
42 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
43 return false;
44
45 Object target_object = target.GetObject();
46
47 if ( target_object && target_object.IsFireplace() )
48 {
49 FireplaceBase fireplace_target = FireplaceBase.Cast( target_object );
50
51 if ( fireplace_target.IsBaseFireplace() && fireplace_target.CanDismantleOven() )
52 {
53 return true;
54 }
55 }
56
57 return false;
58 }
59
60 override void OnFinishProgressServer( ActionData action_data )
61 {
62 Object target_object = action_data.m_Target.GetObject();
63 FireplaceBase fireplace_target = FireplaceBase.Cast( target_object );
64
65 if ( fireplace_target.CanDismantleOven() )
66 {
67 ItemBase attached_item = ItemBase.Cast( fireplace_target.GetAttachmentByType( fireplace_target.ATTACHMENT_STONES ) );
68
69 // for backward compatibility - for the cases built before slot locking was commented out for the stone att slot
70 InventoryLocation inventory_location = new InventoryLocation;
71 attached_item.GetInventory().GetCurrentInventoryLocation( inventory_location );
72 fireplace_target.GetInventory().SetSlotLock( inventory_location.GetSlot(), false );
73
74 //set oven state
75 fireplace_target.SetOvenState( false );
76
77 // extend lifetime (either back to stone circle lifetime or standard fireplace one)
78 if ( fireplace_target.HasStoneCircle() )
79 {
80 fireplace_target.SetLifetimeMax( FireplaceBase.LIFETIME_FIREPLACE_STONE_CIRCLE );
81 }
82 else
83 {
84 fireplace_target.SetLifetimeMax( 10800 );
85 }
86 }
87 }
88}
int m_CommandUID
Определения ActionBase.c:31
int m_StanceMask
Определения ActionBase.c:33
ActionBase ActionData
Определения ActionBase.c:30
ActionDismantleOvenCB ActionContinuousBaseCB ActionDismantleOven()
Определения ActionDismantleOven.c:11
class ActionTargets ActionTarget
eBrokenLegs
Определения EBrokenLegs.c:2
void CreateConditionComponents()
Определения ActionBase.c:230
ActionData m_ActionData
Определения AnimatedActionBase.c:3
override GetInputType()
Определения ActionContinuousBase.c:179
void OnFinishProgressServer(ActionData action_data)
Определения ActionContinuousBase.c:283
override void CreateActionComponent()
Определения ActionDismantleOven.c:3
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения AnimatedActionBase.c:240
Определения CCINotPresent.c:2
Определения CCTNonRuined.c:2
override bool IsBaseFireplace()
Определения BarrelHoles_ColorBase.c:54
proto native int GetSlot()
returns slot id if current type is Attachment
InventoryLocation.
Определения InventoryLocation.c:29
Определения InventoryItem.c:731
Определения ObjectTyped.c:2
Определения PlayerBaseClient.c:2
const float DEFAULT
Определения ActionConstants.c:112
const float DEFAULT_DECONSTRUCT
Определения ActionConstants.c:34
Определения ActionConstants.c:28
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602