20class ActionLockAttachment: ActionContinuousBase
22 private const string LOCK_VERSION =
"#widget_lock";
23 private const string UNLOCK_VERSION =
"#widget_unlock";
24 private string m_Name = LOCK_VERSION;
26 void ActionLockAttachment()
36 override void OnActionInfoUpdate(
PlayerBase player, ActionTarget target,
ItemBase item )
39 if ( target_IB.IsLockedInSlot() )
41 else if ( target_IB.IsAlive() )
64 if ( target_IB && parent_EAI )
72 bool isPresent = targetDoor.GetInventory().GetCurrentInventoryLocation( loc );
74 if ( !isPresent || loc.GetSlot() == -1 )
84 if ( target_IB.IsLockedInSlot() )
85 m_Name = UNLOCK_VERSION;
86 else if ( target_IB.IsAlive() )
87 m_Name = LOCK_VERSION;
88 else if ( !target_IB.IsLockedInSlot() )
91 targetType = target_IB.GetLockType();
93 for (
int i = 0; i < compLock.Count(); i++)
95 if ( targetType == compLock[i] && targetType !=
eLockTypes.NONE)
104 override void OnStartAnimationLoop(
ActionData action_data )
106 super.OnStartAnimationLoop( action_data );
112 g_Game.RPCSingleParam( target_IB,
ERPCs.RPC_SOUND_LOCK_ATTACH, play,
true );
122 g_Game.RPCSingleParam( target_IB,
ERPCs.RPC_SOUND_LOCK_ATTACH, play,
true );
126 override void OnEndAnimationLoop(
ActionData action_data )
128 super.OnEndAnimationLoop( action_data );
134 g_Game.RPCSingleParam( target_IB,
ERPCs.RPC_SOUND_LOCK_ATTACH, play,
true );
138 override void OnFinishProgressServer(
ActionData action_data )
142 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 5);
144 if (target_IB.IsLockedInSlot())
146 target_IB.UnlockFromParent();
150 target_IB.LockToParent();