3 override void CreateActionComponent()
8 void DropDuringRepacking()
10 vector orientation = m_ActionData.m_Player.GetOrientation();
11 vector position = m_ActionData.m_Player.GetPosition() + m_ActionData.m_Player.GetDirection();
17 Math3D.YawPitchRollMatrix( orientation, rotation_matrix );
18 Math3D.MatrixToQuat( rotation_matrix, direction );
20 vector ground_position = position;
21 ground_position[1] =
GetGame().SurfaceY(ground_position[0],ground_position[2]);
25 if ( m_ActionData.m_MainItem.GetInventory().GetCurrentInventoryLocation( source ) )
27 destination.SetGroundEx( m_ActionData.m_MainItem, position, direction );
28 m_ActionData.m_Player.PredictiveTakeToDst(source, destination);
33 if ( m_ActionData.m_MainItem.GetInventory().GetCurrentInventoryLocation( source ) )
35 destination.SetGroundEx( m_ActionData.m_MainItem, ground_position, direction );
36 m_ActionData.m_Player.PredictiveTakeToDst(source, destination);
57 override void CreateConditionComponents()
63 override bool HasTarget()
68 override bool HasProgress()
73 override bool ActionConditionContinue(
ActionData action_data )
78 override bool HasAlternativeInterrupt()
85 if ( !player.IsPlacingLocal() )
94 SetupAnimation( item );
96 if ( super.SetupAction(player, target, item, action_data, extra_data ))
103 override void OnStartServer(
ActionData action_data )
105 m_RepackedEntity =
null;
106 m_IsFinished =
false;
109 override void OnFinishProgressServer(
ActionData action_data )
111 Param1<bool> play =
new Param1<bool>(
false );
117 override void OnEndServer(
ActionData action_data )
121 if ( action_data.m_MainItem.IsInherited(
TentBase ) )
123 RepackLambda lambda_back_pack =
new RepackLambda(action_data.m_MainItem,
"LargeTentBackPack", action_data.m_Player);
124 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lambda_back_pack);
127 if ( action_data.m_MainItem.IsInherited(
Clothing ) )
130 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lambda_tent);
135 if (
GetGame().IsMultiplayer() )
137 if ( action_data.m_MainItem )
139 action_data.m_Player.ServerTakeEntityToHands( action_data.m_MainItem );
144 if ( action_data.m_MainItem )
146 action_data.m_Player.LocalTakeEntityToHands( action_data.m_MainItem );
152 void SetupAnimation(
ItemBase item )
154 if ( item.IsHeavyBehaviour() )
158 else if ( item.IsOneHandedBehaviour() )
162 else if ( item.IsTwoHandedBehaviour() )
168 Print(
"Error: check " + item +
" behaviour");
172 override void OnStartAnimationLoopClient(
ActionData action_data )
174 if ( action_data.m_Player.GetItemInHands() )
178 override void OnStartAnimationLoopServer(
ActionData action_data )
180 Param1<bool> play =
new Param1<bool>(
false );
181 if ( !
GetGame().IsMultiplayer() )
183 if ( action_data.m_Player.GetItemInHands() )
187 if ( action_data.m_Player.GetItemInHands() )
189 play =
new Param1<bool>(
true );
194 override void OnEndAnimationLoop(
ActionData action_data )
198 Param1<bool> play =
new Param1<bool>(
false );
203 override string GetAdminLogMessage(
ActionData action_data)
205 return " re-packed " + action_data.m_Target.GetObject().GetDisplayName() +
" with Hands ";
216 hands.SetHands( player,
null );
217 OverrideNewLocation( hands );