DayZ 1.24
Loading...
Searching...
No Matches
ActionDeployBase.c
Go to the documentation of this file.
2{
6}
7
8class ActiondeployObjectCB : ActionContinuousBaseCB
9{
10 override void CreateActionComponent()
11 {
12 m_ActionData.m_ActionComponent = new CAContinuousTime(m_ActionData.m_MainItem.GetDeployTime());
13 }
14
17}
18
20{
21 protected const float POSITION_OFFSET = 0.5; // The forward offset at which the item will be placed (if not using hologram)
22
24 {
25 m_CallbackClass = ActiondeployObjectCB;
27 m_FullBody = true;
28
29 m_Text = "#deploy_object";
30 }
31
33 {
36 }
37
38 override bool HasTarget()
39 {
40 return false;
41 }
42
43 override bool HasProgress()
44 {
45 return true;
46 }
47
53
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 }
101
103 {
105 if (!Class.CastTo(item, player.GetItemInHands()))
106 return;
107
108 if (item.IsBasebuildingKit())
109 return;
110
111 player.PredictiveDropEntity(item);
112 }
113
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 }
139
144}
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
void DropDuringPlacing()
DEPRECATED.
ActionEmptyMagazine CreateActionComponent
override bool HasTarget()
void DropDuringPlacing(PlayerBase player)
override void OnFinishProgressServer(ActionData action_data)
void MoveEntityToFinalPosition(ActionData action_data, vector position, vector orientation)
override ActionData CreateActionData()
override void CreateConditionComponents()
const float POSITION_OFFSET
override bool HasProgress()
void MoveEntityToFinalPositionSinglePlayer(ActionData action_data, InventoryLocation source, InventoryLocation destination)
Super root of all classes in Enforce script.
Definition EnScript.c:11
InventoryLocation.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
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.