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

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

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

class  DetachActionData
 

Функции

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

Переменные

DetachActionData m_ItemName = ""
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
39 {
40 ItemBase tgt_item = ItemBase.Cast( target.GetObject() );
41 EntityAI tgt_parent = EntityAI.Cast( target.GetParent() );
42 EntityAI tgt_entity = EntityAI.Cast( target.GetObject() );
43
44 if ( !tgt_item || !tgt_entity || !tgt_parent )
45 return false;
46
47 if ( !tgt_parent || !tgt_item.IsItemBase() || !tgt_item.IsTakeable() || tgt_item.IsBeingPlaced() )
48 return false;
49
50 if ( player.GetCommand_Vehicle() )
51 return false;
52
53 if ( player.GetInventory().CanAddEntityIntoHands(tgt_entity) ) //&& !player.GetInventory().CanAddEntityIntoInventory(tgt_entity) )
54 {
55 if ( tgt_entity.GetHierarchyRootPlayer() != player )
56 {
57 if ( tgt_entity.CanDetachAttachment( tgt_parent ) && tgt_parent.CanReleaseAttachment( tgt_entity ) )
58 return true;
59 }
60 }
61
62 return false;
63 }
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95

◆ ActionDetach()

void ActionDetach ( )
11 {
12 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
13 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS;
14 m_Text = "#take_to_hands";
15 }
int m_CommandUIDProne
Definition ActionBase.c:32
int m_CommandUID
Definition ActionBase.c:31
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

Используется в ActionConstructor::RegisterActions(), InventoryItemSuper::SetActions(), CarDoor::SetActions(), ItemBase::SetActions(), SetActions(), Edible_Base::SetActions(), EyeMask_ColorBase::SetActions(), FryingPan::SetActions(), Roadflare::SetActions(), TripodBase::SetActions(), VehicleBattery::SetActions() и WoodenStick::SetActions().

◆ CreateAndSetupActionCallback()

override void CreateAndSetupActionCallback ( ActionData action_data)
81 {
82 EntityAI target = EntityAI.Cast(action_data.m_Target.GetObject());
84 if (!target)
85 return;
86
87 if (target.IsHeavyBehaviour())
88 {
89 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_ERECT));
90 }
91 else
92 {
93 if( action_data.m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT) )
94 {
95 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS,GetCallbackClassTypename()));
96 }
97 else
98 {
99 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HANDS,GetCallbackClassTypename(),DayZPlayerConstants.STANCEMASK_PRONE));
100 }
101 }
102 callback.SetActionData(action_data);
103 callback.InitActionComponent();
104 action_data.m_Callback = callback;
105 }
Definition AnimatedActionBase.c:2
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().

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
18 {
19 m_ConditionItem = new CCINone;
20 m_ConditionTarget = new CCTCursorNoRuinCheck();
21 }
Definition CCINone.c:2
Definition CCTCursorNoRuinCheck.c:2

◆ GetInputType()

override GetInputType ( )
29 {
31 }
Definition ActionInput.c:522

◆ HasProgress()

override bool HasProgress ( )
34 {
35 return false;
36 }

◆ HasProneException()

override bool HasProneException ( )
24 {
25 return true;
26 }

◆ OnExecute()

override void OnExecute ( ActionData action_data)
66 {
67 if (GetGame().IsDedicatedServer())
68 {
69 ClearActionJuncture(action_data);
70 return;
71 }
72
73 ActionManagerClient am = ActionManagerClient.Cast(action_data.m_Player.GetActionManager());
74 am.UnlockInventory(action_data);
75
76 EntityAI ntarget = EntityAI.Cast(action_data.m_Target.GetObject());
77 action_data.m_Player.PredictiveTakeEntityToHands(ntarget);
78 }
Definition ActionManagerClient.c:5
proto native CGame GetGame()

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

Переменные

◆ m_ItemName