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

Protected Member Functions

void ActionDeployBase ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool HasProgress ()
 
override ActionData CreateActionData ()
 
override void OnFinishProgressServer (ActionData action_data)
 
void DropDuringPlacing (PlayerBase player)
 
void MoveEntityToFinalPosition (ActionData action_data, vector position, vector orientation)
 
void MoveEntityToFinalPositionSinglePlayer (ActionData action_data, InventoryLocation source, InventoryLocation destination)
 

Protected Attributes

const float POSITION_OFFSET = 0.5
 

Additional Inherited Members

- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 19 of file ActionDeployBase.c.

Constructor & Destructor Documentation

◆ ActionDeployBase()

void ActionDeployBase::ActionDeployBase ( )
inlineprotected

Definition at line 23 of file ActionDeployBase.c.

24 {
25 m_CallbackClass = ActiondeployObjectCB;
27 m_FullBody = true;
28
29 m_Text = "#deploy_object";
30 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68

References AnimatedActionBase::m_CallbackClass, m_FullBody, m_SpecialtyWeight, m_Text, and UASoftSkillsWeight::PRECISE_LOW.

Member Function Documentation

◆ CreateActionData()

override ActionData ActionDeployBase::CreateActionData ( )
inlineprotected

◆ CreateConditionComponents()

override void ActionDeployBase::CreateConditionComponents ( )
inlineprotected

Definition at line 32 of file ActionDeployBase.c.

33 {
36 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ DropDuringPlacing()

void ActionDeployBase::DropDuringPlacing ( PlayerBase player)
inlineprotected

Definition at line 102 of file ActionDeployBase.c.

103 {
105 if (!Class.CastTo(item, player.GetItemInHands()))
106 return;
107
108 if (item.IsBasebuildingKit())
109 return;
110
111 player.PredictiveDropEntity(item);
112 }
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().

◆ HasProgress()

override bool ActionDeployBase::HasProgress ( )
inlineprotected

Definition at line 43 of file ActionDeployBase.c.

44 {
45 return true;
46 }

◆ HasTarget()

override bool ActionDeployBase::HasTarget ( )
inlineprotected

Definition at line 38 of file ActionDeployBase.c.

39 {
40 return false;
41 }

◆ MoveEntityToFinalPosition()

void ActionDeployBase::MoveEntityToFinalPosition ( ActionData action_data,
vector position,
vector orientation )
inlineprotected

Definition at line 114 of file ActionDeployBase.c.

115 {
116 if (action_data.m_MainItem.IsBasebuildingKit())
117 return;
118
121 float direction[4];
124
127
128 if (entity_for_placing.GetInventory().GetCurrentInventoryLocation(source))
129 {
131
132 if (GetGame().IsMultiplayer())
133 action_data.m_Player.ServerTakeToDst(source, destination);
134 else // singleplayer
136
137 }
138 }
void MoveEntityToFinalPositionSinglePlayer(ActionData action_data, InventoryLocation source, InventoryLocation destination)
InventoryLocation.
proto native CGame GetGame()
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.

References GetGame(), Math3D::MatrixToQuat(), MoveEntityToFinalPositionSinglePlayer(), and Math3D::YawPitchRollMatrix().

Referenced by OnFinishProgressServer().

◆ MoveEntityToFinalPositionSinglePlayer()

void ActionDeployBase::MoveEntityToFinalPositionSinglePlayer ( ActionData action_data,
InventoryLocation source,
InventoryLocation destination )
inlineprotected

Definition at line 140 of file ActionDeployBase.c.

141 {
142 action_data.m_Player.GetInventory().TakeToDst(InventoryMode.LOCAL, source, destination);
143 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22

Referenced by MoveEntityToFinalPosition().

◆ OnFinishProgressServer()

override void ActionDeployBase::OnFinishProgressServer ( ActionData action_data)
inlineprotected

Definition at line 54 of file ActionDeployBase.c.

55 {
58
59 if (!poActionData)
60 return;
61
62 if (!action_data.m_MainItem)
63 return;
64
68
69 // In case of placement with hologram
70 if (action_data.m_Player.GetHologramServer())
71 {
72 position = action_data.m_Player.GetLocalProjectionPosition();
73 orientation = action_data.m_Player.GetLocalProjectionOrientation();
74
75 action_data.m_Player.GetHologramServer().EvaluateCollision(action_data.m_MainItem);
76 if (GetGame().IsMultiplayer() && action_data.m_Player.GetHologramServer().IsColliding())
77 return;
78
79 action_data.m_Player.GetHologramServer().PlaceEntity(entity_for_placing);
80
81 if (GetGame().IsMultiplayer())
82 action_data.m_Player.GetHologramServer().CheckPowerSource();
83 }
84 else
85 {
86 position = action_data.m_Player.GetPosition();
87 orientation = action_data.m_Player.GetOrientation();
88 position = position + (action_data.m_Player.GetDirection() * POSITION_OFFSET);
89 }
90
91 action_data.m_Player.PlacingCompleteServer();
92 entity_for_placing.OnPlacementComplete(action_data.m_Player, position, orientation);
93
95 GetGame().ClearJunctureEx(action_data.m_Player, entity_for_placing);
96 action_data.m_MainItem.SetIsBeingPlaced(false);
97 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
98 poActionData.m_AlreadyPlaced = true;
99 action_data.m_MainItem.SoundSynchRemoteReset();
100 }
void MoveEntityToFinalPosition(ActionData action_data, vector position, vector orientation)
const float POSITION_OFFSET

References GetGame(), m_SpecialtyWeight, MoveEntityToFinalPosition(), and POSITION_OFFSET.

Member Data Documentation

◆ POSITION_OFFSET

const float ActionDeployBase::POSITION_OFFSET = 0.5
protected

Definition at line 21 of file ActionDeployBase.c.

Referenced by OnFinishProgressServer().


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