class GlitchedTurretController extends ScriptableDeviceComponent
{

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

}

class GlitchedTurretControllerPS extends ScriptableDeviceComponentPS
{
	default m_deviceName = "LocKey#121";
	default m_tweakDBRecord = T"Devices.SecurityTurret";
	default m_tweakDBDescriptionRecord = T"device_descriptions.SecurityTurret";

	protected event OnInstantiated()
	{
		super.OnInstantiated();
		if( !( IsStringValid( m_deviceName ) ) )
		{
			m_deviceName = "Gameplay-Devices-DisplayNames-TurretSecurity";
		}
	}

	protected override function Initialize()
	{
		super.Initialize();
	}

	public override function GetQuestActions( out outActions : array< DeviceAction >, const context : ref< GetActionsContext > )
	{
		super.GetQuestActions( outActions, context );
		outActions.PushBack( ActionQuestForceGlitch() );
	}

	protected function ActionQuestForceGlitch() : QuestForceGlitch
	{
		var action : QuestForceGlitch;
		action = new QuestForceGlitch;
		action.clearanceLevel = DefaultActionsParametersHolder.GetQuestClearance();
		action.SetUp( this );
		action.SetProperties();
		action.AddDeviceName( m_deviceName );
		return action;
	}

	public virtual function OnQuestForceGlitch( evt : QuestForceGlitch ) : EntityNotificationType
	{
		var notifier : ActionNotifier;
		notifier = new ActionNotifier;
		notifier.SetNone();
		Notify( notifier, evt );
		return EntityNotificationType.SendThisEventToEntity;
	}

}

class QuestForceGlitch extends ActionBool
{

	public function SetProperties()
	{
		actionName = 'ForceGlitch';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'QuestForceGlitch', true, 'QuestForceGlitch', 'QuestForceGlitch' );
	}

}

