class MuteArmDurationModifier extends EffectDurationModifier_Scripted
{
	editable var initialDuration : Float;

	public function Init( ctx : EffectScriptContext ) : Float
	{
		return initialDuration;
	}

	public function Process( ctx : EffectScriptContext, durationCtx : EffectDurationModifierScriptContext ) : Float
	{
		if( ( EffectDurationModifierScriptContext.GetRemainingTime( durationCtx ) - EffectDurationModifierScriptContext.GetTimeDelta( durationCtx ) ) <= 0.0 )
		{
			ResetMuteArmBlackboard( ctx );
		}
		return EffectDurationModifierScriptContext.GetRemainingTime( durationCtx ) - EffectDurationModifierScriptContext.GetTimeDelta( durationCtx );
	}

	protected function ResetMuteArmBlackboard( ctx : EffectScriptContext )
	{
		var blackboardSystem : BlackboardSystem;
		var blackboard : IBlackboard;
		blackboardSystem = GameInstance.GetBlackboardSystem( EffectScriptContext.GetGameInstance( ctx ) );
		blackboard = blackboardSystem.Get( GetAllBlackboardDefs().CW_MuteArm );
		blackboard.SetBool( GetAllBlackboardDefs().CW_MuteArm.MuteArmActive, false, true );
		blackboard.SetFloat( GetAllBlackboardDefs().CW_MuteArm.MuteArmRadius, 0.0, true );
	}

}

