DayZ 1.24
Loading...
Searching...
No Matches
ActionRepositionPluggedItem Class Reference
Inheritance diagram for ActionRepositionPluggedItem:
[legend]
Collaboration diagram for ActionRepositionPluggedItem:
[legend]

Protected Attributes

ItemBase m_SourceForReplug
 DEPRECATED.
 

Private Member Functions

void ActionRepositionPluggedItem ()
 
override GetInputType ()
 
override bool HasProgress ()
 
override bool CanBeUsedOnBack ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanContinue (ActionData action_data)
 
override void Start (ActionData action_data)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
override void CreateAndSetupActionCallback (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionRepositionPluggedItem.c.

Constructor & Destructor Documentation

◆ ActionRepositionPluggedItem()

void ActionRepositionPluggedItem::ActionRepositionPluggedItem ( )
inlineprivate

Definition at line 4 of file ActionRepositionPluggedItem.c.

5 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
9
10 m_Text = "#reposition";
11 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionRepositionPluggedItem::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 28 of file ActionRepositionPluggedItem.c.

29 {
30 ItemBase targetItem = ItemBase.Cast(target.GetObject());
31 EntityAI targetParent = EntityAI.Cast(targetItem.GetHierarchyParent());
32 if (!targetItem || !targetItem.IsTakeable() || targetItem.IsBeingPlaced() || (targetItem.GetCompEM() && !targetItem.GetCompEM().IsPlugged()) || (targetItem.GetHierarchyParent() && !BaseBuildingBase.Cast(targetItem.GetHierarchyParent())) || ((targetParent && !targetItem.CanDetachAttachment(targetParent)) || (targetParent && !targetParent.CanReleaseAttachment(targetItem))))
33 return false;
34
35 if (targetItem.HasEnergyManager() && targetItem.GetCompEM().IsPlugged())
36 return player.GetInventory().CanAddEntityIntoHands(targetItem);
37
38 return false;
39 }

◆ CanBeUsedOnBack()

override bool ActionRepositionPluggedItem::CanBeUsedOnBack ( )
inlineprivate

Definition at line 23 of file ActionRepositionPluggedItem.c.

24 {
25 return false;
26 }

◆ CanContinue()

override bool ActionRepositionPluggedItem::CanContinue ( ActionData action_data)
inlineprivate

Definition at line 41 of file ActionRepositionPluggedItem.c.

42 {
43 EntityAI ent = EntityAI.Cast(action_data.m_Target.GetObject());
44 return ent && ent.GetCompEM().GetCordLength() > 0;
45 }

◆ CreateAndSetupActionCallback()

override void ActionRepositionPluggedItem::CreateAndSetupActionCallback ( ActionData action_data)
inlineprivate

Definition at line 79 of file ActionRepositionPluggedItem.c.

80 {
81 EntityAI target = EntityAI.Cast(action_data.m_Target.GetObject());
83 if (!target)
84 return;
85
86 if (target.IsHeavyBehaviour())
87 Class.CastTo(callback, action_data.m_Player.StartCommand_Action(DayZPlayerConstants.CMD_ACTIONFB_PICKUP_HEAVY, GetCallbackClassTypename(), DayZPlayerConstants.STANCEMASK_ERECT));
88 else
89 Class.CastTo(callback, action_data.m_Player.AddCommandModifier_Action(DayZPlayerConstants.CMD_ACTIONMOD_PICKUP_HANDS, GetCallbackClassTypename()));
90
91 callback.SetActionData(action_data);
92 callback.InitActionComponent();
93 action_data.m_Callback = callback;
94 }
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.

References Class::CastTo(), and AnimatedActionBase::GetCallbackClassTypename().

◆ GetInputType()

override ActionRepositionPluggedItem::GetInputType ( )
inlineprivate

◆ HasProgress()

override bool ActionRepositionPluggedItem::HasProgress ( )
inlineprivate

Definition at line 18 of file ActionRepositionPluggedItem.c.

19 {
20 return false;
21 }

◆ OnExecuteClient()

override void ActionRepositionPluggedItem::OnExecuteClient ( ActionData action_data)
inlineprivate

Definition at line 70 of file ActionRepositionPluggedItem.c.

71 {
73 ItemBase ntarget = ItemBase.Cast(action_data.m_Target.GetObject());
75
76 action_data.m_Player.PredictiveTakeEntityToHands(ntarget);
77 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:790
InventoryLocation.

References ClearInventoryReservationEx().

◆ OnExecuteServer()

override void ActionRepositionPluggedItem::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 58 of file ActionRepositionPluggedItem.c.

59 {
60 if (GetGame().IsMultiplayer())
61 return;
62
64 ItemBase ntarget = ItemBase.Cast(action_data.m_Target.GetObject());
66
67 action_data.m_Player.PredictiveTakeEntityToHands(ntarget);
68 }
proto native CGame GetGame()

References ClearInventoryReservationEx(), and GetGame().

◆ Start()

override void ActionRepositionPluggedItem::Start ( ActionData action_data)
inlineprivate

Definition at line 47 of file ActionRepositionPluggedItem.c.

48 {
49 super.Start(action_data);
50
51 ItemBase ntarget = ItemBase.Cast(action_data.m_Target.GetObject());
52 if (GetGame().IsMultiplayer() && GetGame().IsServer())
53 action_data.m_Player.PlacingStartServer(ntarget);
54 else
55 action_data.m_Player.TogglePlacingLocal(ntarget);
56 }

References GetGame().

Member Data Documentation

◆ m_SourceForReplug

ItemBase ActionRepositionPluggedItem::m_SourceForReplug
protected

DEPRECATED.

Definition at line 97 of file ActionRepositionPluggedItem.c.


The documentation for this class was generated from the following file: