3 const float DEFAULT_UNRESTRAIN_TIME = 2;
5 override void CreateActionComponent()
7 float time = ObtainUnrestrainTime();
11 time = DEFAULT_UNRESTRAIN_TIME;
14 if( m_ActionData.m_Player.IsQuickRestrain() )
22 float ObtainUnrestrainTime()
25 PlayerBase source_player = m_ActionData.m_Player;
27 if (target_player.IsRestrained())
29 EntityAI item_in_hands_source = source_player.GetItemInHands();
31 ItemBase item_in_hands_target = target_player.GetItemInHands();
34 item_in_hands_target.ConfigGetTextArray(
"CanBeUnrestrainedBy",
CachedObjectsArrays.ARRAY_STRING );
36 string item_in_hands_name = item_in_hands_source.GetType();
67 override void CreateConditionComponents()
76 EntityAI item_in_hands_source = player.GetItemInHands();
78 if( other_player.IsRestrained() )
81 EntityAI item_in_hands_target = other_player.GetItemInHands();
85 if( item_in_hands_target )
87 item_in_hands_target.ConfigGetTextArray(
"CanBeUnrestrainedBy",
CachedObjectsArrays.ARRAY_STRING );
89 string item_in_hands_name = item_in_hands_source.GetType();
107 override void OnFinishProgressServer(
ActionData action_data )
114 EntityAI unrestraining_tool = action_data.m_MainItem;
115 EntityAI restraining_item = player_target.GetItemInHands();
117 player_target.SetRestrained(
false);
123 restraining_item.ConfigGetTextArray(
"CanBeUnrestrainedBy",
CachedObjectsArrays.ARRAY_STRING );
124 restraining_item.ConfigGetFloatArray(
"CanBeUnrestrainedByDMG",
CachedObjectsArrays.ARRAY_FLOAT );
126 string item_in_hands_name = unrestraining_tool.GetType();
127 float damageToTool = 0;
139 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, damageToTool);
142 MiscGameplayFunctions.TransformRestrainItem(restraining_item, unrestraining_tool, player_source, player_target);
159 m_OldItem = old_item;
162 override void OnSuccess(
EntityAI new_item)
164 super.OnSuccess(new_item);
168 new_item.SetHealth(
"",
"",0);
180 override protected EntityAI CreateNewEntity()
182 EntityAI newItem = super.CreateNewEntity();
184 if (!newItem && m_Drop)