3 override void CreateActionComponent()
8 void DropDuringRepacking()
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);
58 override void CreateConditionComponents()
64 override bool HasTarget()
69 override bool HasProgress()
74 override bool ActionConditionContinue( ActionData action_data )
79 override bool HasAlternativeInterrupt()
86 if ( !player.IsPlacingLocal() )
93 override bool SetupAction(
PlayerBase player, ActionTarget target,
ItemBase item, out ActionData action_data,
Param extra_data = NULL)
95 SetupAnimation( item );
97 if ( super.SetupAction(player, target, item, action_data, extra_data ))
104 override void OnStartServer( ActionData action_data )
106 super.OnStartServer(action_data);
108 m_RepackedEntity = null;
109 m_IsFinished =
false;
112 override void OnFinishProgressServer( ActionData action_data )
114 Param1<bool> play =
new Param1<bool>(
false );
120 override void OnEndServer( ActionData action_data )
122 super.OnEndServer(action_data);
126 if ( action_data.m_MainItem.IsInherited(
TentBase ) )
128 RepackLambda lambda_back_pack =
new RepackLambda(action_data.m_MainItem,
"LargeTentBackPack", action_data.m_Player);
129 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lambda_back_pack);
132 if ( action_data.m_MainItem.IsInherited(
Clothing ) )
135 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lambda_tent);
140 if (
GetGame().IsMultiplayer() )
142 if ( action_data.m_MainItem )
144 action_data.m_Player.ServerTakeEntityToHands( action_data.m_MainItem );
149 if ( action_data.m_MainItem )
151 action_data.m_Player.LocalTakeEntityToHands( action_data.m_MainItem );
157 void SetupAnimation(
ItemBase item )
159 if ( item.IsHeavyBehaviour() )
163 else if ( item.IsOneHandedBehaviour() )
167 else if ( item.IsTwoHandedBehaviour() )
173 Print(
"Error: check " + item +
" behaviour");
177 override void OnStartAnimationLoopClient( ActionData action_data )
179 if ( action_data.m_Player.GetItemInHands() )
183 override void OnStartAnimationLoopServer( ActionData action_data )
185 Param1<bool> play =
new Param1<bool>(
false );
186 if ( !
GetGame().IsMultiplayer() )
188 if ( action_data.m_Player.GetItemInHands() )
192 if ( action_data.m_Player.GetItemInHands() )
194 play =
new Param1<bool>(
true );
199 override void OnEndAnimationLoop( ActionData action_data )
203 Param1<bool> play =
new Param1<bool>(
false );
208 override string GetAdminLogMessage(ActionData action_data)
210 return " re-packed " + action_data.m_Target.GetObject().GetDisplayName() +
" with Hands ";