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

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

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

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

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

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

void ActionTakeMaterialToHands ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
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.

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

◆ ActionTakeMaterialToHands()

void ActionTakeMaterialToHands ( )
inlineprivate
5 {
6 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
7 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS;
8 m_Text = "#take";
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
44 {
45 EntityAI target_entity = EntityAI.Cast( target.GetObject() );
46 if ( target_entity && target_entity.CanUseConstruction() )
47 {
49 if(!base_building.IsPlayerInside(player,""))
50 return false;
51
52 ConstructionActionData construction_action_data = player.GetConstructionActionData();
53 string main_part_name = target_entity.GetActionComponentName( target.GetComponentIndex() );
54 //Print(main_part_name);
55
56 if ( GetGame().IsMultiplayer() || GetGame().IsServer() )
57 {
58 construction_action_data.RefreshAttachmentsToDetach( target_entity, main_part_name );
59 }
60 EntityAI attachment = construction_action_data.GetActualAttachmentToDetach();
61
62 if ( attachment && player.GetInventory().CanAddEntityIntoHands( attachment ) && attachment.GetHierarchyRootPlayer() != player )
63 {
64 return true;
65 }
66 }
67
68 return false;
69 }
Definition Fence.c:2
Definition ConstructionActionData.c:2
Definition Building.c:6
Definition EntityAI.c:95
proto native CGame GetGame()

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

◆ CanContinue()

override bool CanContinue ( ActionData action_data)
inlineprivate
72 {
73 return true;
74 }

◆ CreateAndSetupActionCallback()

override void CreateAndSetupActionCallback ( ActionData action_data)
inlineprotected
109 {
110 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
111 EntityAI target = construction_action_data.GetActualAttachmentToDetach();
112
113 bool heavy_item = false;
115 if ( target && target.ConfigIsExisting("heavyItem") && target.ConfigGetBool("heavyItem") )
116 {
117 heavy_item = true;
118 }
119
120 if( heavy_item )
121 {
122 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_ERECT));
123 }
124 else
125 {
126 if( action_data.m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT) )
127 {
128 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS,GetCallbackClassTypename()));
129 }
130 else
131 {
132 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_PRONE));
133 }
134 }
135 callback.SetActionData(action_data);
136 callback.InitActionComponent();
137 action_data.m_Callback = callback;
138 }
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
34 {
36 }
Definition ActionInput.c:522

◆ HasProgress()

override bool HasProgress ( )
inlineprivate
39 {
40 return false;
41 }

◆ HasProneException()

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

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
23 {
24 ConstructionActionData construction_action_data = player.GetConstructionActionData();
25 EntityAI attachment = construction_action_data.GetActualAttachmentToDetach();
26
27 if ( attachment )
28 {
29 m_Text = "#take " + attachment.GetDisplayName();
30 }
31 }

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

◆ OnExecute()

override void OnExecute ( ActionData action_data)
inlineprivate
77 {
78 if (GetGame().IsDedicatedServer())
79 {
81 return;
82 }
83
85 }
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979
void OnExecuteImpl(ActionData action_data)
Definition ActionTakeMaterialToHands.c:87

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

◆ OnExecuteImpl()

void OnExecuteImpl ( ActionData action_data)
inlineprotected
88 {
89 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
90 ItemBase item_target = ItemBase.Cast( construction_action_data.GetActualAttachmentToDetach() );
91 if( item_target )
92 {
93 float stackable = item_target.GetTargetQuantityMax();
94
95 if( stackable == 0 || stackable >= item_target.GetQuantity() )
96 {
97 //take to hands
98 action_data.m_Player.PredictiveTakeEntityToHands( item_target );
99 }
100 else if( stackable != 0 && stackable < item_target.GetQuantity() )
101 {
102 //split and take to hands
103 item_target.SplitIntoStackMaxHandsClient( action_data.m_Player );
104 }
105 }
106 }
Definition InventoryItem.c:731

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


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