class OverrideRangedAttackPackageEffector extends Effector
{
	var m_attackPackage : RangedAttackPackage_Record;

	protected export override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		var effectorRecord : OverrideRangedAttackPackageEffector_Record;
		effectorRecord = TweakDBInterface.GetOverrideRangedAttackPackageEffectorRecord( record );
		m_attackPackage = effectorRecord.AttackPackage();
	}

	protected override function RepeatedAction( owner : GameObject )
	{
		ActionOn( owner );
	}

	protected override function ActionOn( owner : GameObject )
	{
		var targetObject : weak< GameObject >;
		var targetWeapon : WeaponObject;
		if( !( GetApplicationTarget( owner, 'Weapon', targetObject ) ) )
		{
			return;
		}
		targetWeapon = ( ( WeaponObject )( targetObject ) );
		if( targetWeapon )
		{
			targetWeapon.OverrideRangedAttackPackage( m_attackPackage );
		}
	}

	protected override function ActionOff( owner : GameObject )
	{
		var targetObject : weak< GameObject >;
		var targetWeapon : WeaponObject;
		if( !( GetApplicationTarget( owner, 'Weapon', targetObject ) ) )
		{
			return;
		}
		targetWeapon = ( ( WeaponObject )( targetObject ) );
		if( targetWeapon )
		{
			targetWeapon.DefaultRangedAttackPackage();
		}
	}

}

