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

DEPRECATED. Подробнее...

+ Граф наследования:ActionTakeHybridAttachmentToHands:

Защищенные члены

void OnExecuteImpl (ActionData action_data)
 
override void CreateAndSetupActionCallback (ActionData action_data)
 

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

void ActionTakeHybridAttachmentToHands ()
 
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 OnExecute (ActionData action_data)
 

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

DEPRECATED.

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

◆ ActionTakeHybridAttachmentToHands()

5 {
6 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
7 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS;
8 m_Text = "#take_to_hands";
9 }
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
33 {
34 EntityAI tgt_entity = EntityAI.Cast( target.GetObject() );
35
36 if ( tgt_entity && BaseBuildingBase.Cast(tgt_entity) &&!tgt_entity.IsBeingPlaced() /*&& BaseBuildingBase.Cast(tgt_entity).IsPlayerInside(player,"")*/ )
37 {
38 string component_name = tgt_entity.GetActionComponentName( target.GetComponentIndex() );
39
40 ItemBase attachment = ItemBase.Cast(tgt_entity.FindAttachmentBySlotName(component_name));
41
42 if ( attachment && player.GetInventory().CanAddEntityIntoHands(attachment) && attachment.IsTakeable() )
43 {
44 return true;
45 }
46 }
47 return false;
48 }
Definition Fence.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ CanContinue()

override bool CanContinue ( ActionData action_data)
inlineprivate
51 {
52 return true;
53 }

◆ CreateAndSetupActionCallback()

override void CreateAndSetupActionCallback ( ActionData action_data)
inlineprotected
91 {
92 EntityAI tgt_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
93 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
95 bool heavy_item = false;
96
97 if ( tgt_entity && ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
98 {
100 if ( attachment && attachment.ConfigIsExisting("heavyItem") && attachment.ConfigGetBool("heavyItem") )
101 {
102 heavy_item = true;
103 }
104 }
105
106 if( heavy_item )
107 {
108 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_ERECT));
109 }
110 else
111 {
112 if( action_data.m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT) )
113 {
114 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS,GetCallbackClassTypename()));
115 }
116 else
117 {
118 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_PRONE));
119 }
120 }
121 callback.SetActionData(action_data);
122 callback.InitActionComponent();
123 action_data.m_Callback = callback;
124 }
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().

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
12 {
15 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINotPresent.c:2
Definition CCTCursor.c:2

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

◆ GetInputType()

override GetInputType ( )
inlineprivate
23 {
25 }
Definition ActionInput.c:522

◆ HasProgress()

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

◆ HasProneException()

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

◆ OnExecute()

override void OnExecute ( ActionData action_data)
inlineprivate
56 {
57 if (GetGame().IsDedicatedServer())
58 {
60 return;
61 }
62
64 }
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979
void OnExecuteImpl(ActionData action_data)
Definition ActionTakeHybridAttachmentToHands.c:66
proto native CGame GetGame()

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

◆ OnExecuteImpl()

void OnExecuteImpl ( ActionData action_data)
inlineprotected
67 {
68 EntityAI tgt_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
69 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
71
72 if ( tgt_entity && ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
73 {
75 float stackable = attachment.GetTargetQuantityMax(-1);
76
77 if( stackable == 0 || stackable >= attachment.GetQuantity() )
78 {
79 //take to hands
80 action_data.m_Player.PredictiveTakeEntityToHands( attachment );
81 }
82 else if( stackable != 0 && stackable < attachment.GetQuantity() )
83 {
84 //split and take to hands
85 attachment.SplitIntoStackMaxHandsClient( action_data.m_Player );
86 }
87 }
88 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921

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

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


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