class ModifyDamageWithLeapedDistance extends ModifyDamageEffector
{
	var m_maxPercentMult : Float;
	var m_minDistance : Float;
	var m_maxDistance : Float;

	protected override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		super.Initialize( record, game, parentRecord );
		m_maxPercentMult = TweakDBInterface.GetFloat( record + T".maxPercentMult", 0.0 );
		m_minDistance = TweakDBInterface.GetFloat( record + T".minDistance", 0.0 );
		m_maxDistance = TweakDBInterface.GetFloat( record + T".maxDistance", 0.0 );
	}

	protected override function Uninitialize( game : GameInstance ) {}

	protected override function RepeatedAction( owner : GameObject )
	{
		var hitEvent : gameHitEvent;
		var playerPerkDataBB : IBlackboard;
		var leapedDistance : Float;
		hitEvent = GetHitEvent();
		if( !( hitEvent ) )
		{
			return;
		}
		playerPerkDataBB = GameInstance.GetBlackboardSystem( owner.GetGame() ).Get( GetAllBlackboardDefs().PlayerPerkData );
		if( playerPerkDataBB )
		{
			leapedDistance = playerPerkDataBB.GetFloat( GetAllBlackboardDefs().PlayerPerkData.LeapedDistance );
			if( ( ( leapedDistance > m_maxDistance ) || ( m_minDistance == m_maxDistance ) ) || ( m_maxDistance == 0.0 ) )
			{
				ModifyDamage( hitEvent, m_operationType, m_maxPercentMult );
			}
			else if( leapedDistance > m_minDistance )
			{
				ModifyDamage( hitEvent, m_operationType, 1.0 + ( ( ( m_maxPercentMult - 1.0 ) * leapedDistance ) / m_maxDistance ) );
			}
		}
	}

}

