DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionTakeItemToHands
+ Граф наследования:ActionTakeItemToHands:

Закрытые члены

void ActionTakeItemToHands ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
override GetInputType ()
 
override bool HasProgress ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanContinue (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 
override void CreateAndSetupActionCallback (ActionData action_data)
 
override bool CanBeUsedOnBack ()
 

Подробное описание

Конструктор(ы)

◆ ActionTakeItemToHands()

void ActionTakeItemToHands ( )
inlineprivate
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
6 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS;
7 m_Text = "#take_to_hands";
8 }
string m_Text
Definition ActionBase.c:58
int m_CommandUIDProne
Definition AnimatedActionBase.c:144
int m_CommandUID
Definition AnimatedActionBase.c:143
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CommandUID, AnimatedActionBase::m_CommandUIDProne и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
32 {
33 ItemBase targetItem = ItemBase.Cast(target.GetObject());
34 if (!targetItem)
35 return false;
36
37 EntityAI targetParent = EntityAI.Cast(targetItem.GetHierarchyParent());
38 if (!targetItem.IsTakeable() || targetItem.IsBeingPlaced() || targetItem.IsSetForDeletion() || ( targetItem.GetHierarchyParent() && !BaseBuildingBase.Cast(targetParent) ) || ((targetParent && !targetItem.CanDetachAttachment(targetParent)) || (targetParent && !targetParent.CanReleaseAttachment(targetItem))))
39 return false;
40
41 return player.GetInventory().CanAddEntityIntoHands(targetItem);
42 }
Definition Fence.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ CanBeUsedOnBack()

override bool CanBeUsedOnBack ( )
inlineprivate
114 {
115 return true;
116 }

◆ CanContinue()

override bool CanContinue ( ActionData action_data)
inlineprivate
45 {
46 return true;
47 }

◆ CreateAndSetupActionCallback()

override void CreateAndSetupActionCallback ( ActionData action_data)
inlineprivate
84 {
85 EntityAI target = EntityAI.Cast(action_data.m_Target.GetObject());
86 if (!target)
87 return;
88
90
91 if (target.IsHeavyBehaviour())
92 {
93 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(), DayZPlayerConstants.STANCEMASK_ERECT));
94 }
95 else
96 {
97 if (action_data.m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT))
98 {
99 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(m_CommandUID,GetCallbackClassTypename()));
100 }
101 else
102 {
103 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(m_CommandUIDProne,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_PRONE));
104 }
105 }
106
107 callback.SetActionData(action_data);
108 callback.InitActionComponent();
109 action_data.m_Callback = callback;
110 }
Definition AnimatedActionBase.c:2
GetCallbackClassTypename()
Definition AnimatedActionBase.c:307
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), AnimatedActionBase::GetCallbackClassTypename(), AnimatedActionBase::m_CommandUID и AnimatedActionBase::m_CommandUIDProne.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
11 {
14 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.c:2
Definition CCTObject.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

Перекрестные ссылки UAMaxDistances::DEFAULT, ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ GetInputType()

override GetInputType ( )
inlineprivate
22 {
24 }
Definition ActionInput.c:522

◆ HasProgress()

override bool HasProgress ( )
inlineprivate
27 {
28 return false;
29 }

◆ HasProneException()

override bool HasProneException ( )
inlineprivate
17 {
18 return true;
19 }

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprivate
50 {
51 super.OnEndServer(action_data);
52
53 EntityAI takenEntity = EntityAI.Cast(action_data.m_Target.GetObject());
54 if (takenEntity && takenEntity.GetCompEM() && takenEntity.IsElectricAppliance())
55 takenEntity.GetCompEM().UnplugThis();
56 }

◆ OnExecute()

override void OnExecute ( ActionData action_data)
inlineprivate
59 {
60 if (GetGame().IsDedicatedServer())
61 {
63 return;
64 }
65
66 ItemBase ntarget = ItemBase.Cast(action_data.m_Target.GetObject());
68
69 float stackable = ntarget.GetTargetQuantityMax(-1);
70
71 if (stackable == 0 || stackable >= ntarget.GetQuantity())
72 {
73 action_data.m_Player.PredictiveTakeEntityToHands(ntarget);
74 }
75 else
76 {
78 il.SetHands(action_data.m_Player, ntarget);
79 ntarget.SplitIntoStackMaxToInventoryLocationClient(il);
80 }
81 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979
InventoryLocation.
Definition InventoryLocation.c:29
proto native CGame GetGame()

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


Объявления и описания членов класса находятся в файле: