3 const float DEFAULT_STRUGGLE_TIME = 2;
4 const float UNRESTRAIN_STRUGGLE_MULTIPLIER = 0.75;
6 override void CreateActionComponent()
8 float time = DEFAULT_STRUGGLE_TIME;
10 EntityAI item_in_hands = targetPlayer.GetItemInHands();
12 if ( item_in_hands.ConfigIsExisting(
"StruggleLength") )
14 time = item_in_hands.ConfigGetFloat(
"StruggleLength") * UNRESTRAIN_STRUGGLE_MULTIPLIER;
17 if ( m_ActionData.m_Player.IsQuickRestrain() )
38 override typename GetInputType()
45 override void OnStartServer(
ActionData action_data)
47 action_data.m_Player.TryHideItemInHands(
true);
50 override void OnEndServer(
ActionData action_data)
52 action_data.m_Player.TryHideItemInHands(
false);
55 override void CreateConditionComponents()
64 return targetPlayer && targetPlayer.IsRestrained();
67 override void OnFinishProgressServer(
ActionData action_data )
73 EntityAI item_in_hands = targetPlayer.GetItemInHands();
74 targetPlayer.SetRestrained(
false);
77 MiscGameplayFunctions.TransformRestrainItem(item_in_hands,
null, action_data.m_Player, targetPlayer);
81 ErrorEx(
"Failed to obtain item in target player's hands during empty handed unrestraining");
86 override void OnStartClient(
ActionData action_data)
88 action_data.m_Player.TryHideItemInHands(
true);
91 override void OnEndClient(
ActionData action_data )
93 if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(
false);