class NetrunnerChairController extends ScriptableDeviceComponent
{

	public const override function GetPS() : NetrunnerChairControllerPS
	{
		return ( ( NetrunnerChairControllerPS )( GetBasePS() ) );
	}

}

class NetrunnerChairControllerPS extends ScriptableDeviceComponentPS
{
	default m_deviceName = "LocKey#17884";
	default m_tweakDBRecord = T"Devices.NetrunnerChair";
	default m_tweakDBDescriptionRecord = T"device_descriptions.NetrunnerChair";
	protected editable var m_killDelay : Float;
	default m_killDelay = 1.0f;
	protected var m_wasOverloaded : Bool;
	default m_wasOverloaded = false;

	protected const override function CanCreateAnyQuickHackActions() : Bool
	{
		return true;
	}

	protected override function GetQuickHackActions( out actions : array< DeviceAction >, const context : ref< GetActionsContext > )
	{
		var currentAction : ScriptableDeviceAction;
		currentAction = ActionOverloadDevice();
		currentAction.SetObjectActionID( T"DeviceAction.OverloadClassHack" );
		currentAction.SetInactiveWithReason( !( m_wasOverloaded ) && IsSomeoneUsingNPCWorkspot(), "LocKey#7011" );
		actions.PushBack( currentAction );
		FinalizeGetQuickHackActions( actions, context );
	}

	protected override function ActionOverloadDevice() : OverloadDevice
	{
		var action : OverloadDevice;
		action = super.ActionOverloadDevice();
		action.SetKillDelay( m_killDelay );
		return action;
	}

	protected override function OnOverloadDevice( evt : OverloadDevice ) : EntityNotificationType
	{
		var npc : GameObject;
		npc = GameInstance.GetWorkspotSystem( GetGameInstance() ).GetDeviceUser( PersistentID.ExtractEntityID( GetID() ) );
		if( npc )
		{
			StatusEffectHelper.ApplyStatusEffect( npc, T"WorkspotStatus.Death", m_killDelay );
		}
		m_wasOverloaded = true;
		return super.OnOverloadDevice( evt );
	}

}

