class HardToKillDamageModificationEffector extends ModifyAttackEffector
{
	var m_criticalHealthThreshold : Float;

	protected export override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_criticalHealthThreshold = TweakDBInterface.GetFloat( record + T".criticalHealthThreshold", 0.0 );
	}

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

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

	private function ProcessAction( owner : GameObject )
	{
		var hitEvent : gameHitEvent;
		var attackdamage : Float;
		var healthPercentage : Float;
		var poolSys : StatPoolsSystem;
		hitEvent = GetHitEvent();
		poolSys = GameInstance.GetStatPoolsSystem( owner.GetGame() );
		if( !( hitEvent ) )
		{
			return;
		}
		if( AttackData.IsDoT( hitEvent.attackData ) )
		{
			return;
		}
		attackdamage = hitEvent.attackComputed.GetTotalAttackValue( gamedataStatPoolType.Health );
		healthPercentage = poolSys.GetStatPoolValue( owner.GetEntityID(), gamedataStatPoolType.Health );
		if( ( attackdamage > 0.0 ) && ( healthPercentage <= m_criticalHealthThreshold ) )
		{
			hitEvent.attackComputed.MultAttackValue( 0.0 );
			poolSys.RequestChangingStatPoolValue( owner.GetEntityID(), gamedataStatPoolType.AccumulatedDoT, attackdamage, owner, false, false );
		}
	}

}

