class WeirdTankyPlatingEffector extends ModifyAttackEffector
{
	private var m_armorMultiplier : Float;

	protected override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_armorMultiplier = TweakDBInterface.GetFloat( record + T".armorMultiplier", 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 damage : Float;
		var hitDirectionInt : Int32;
		var armorPoints : Float;
		var statsSystem : StatsSystem;
		var effectiveHealthPerArmorPoint : Float;
		hitEvent = GetHitEvent();
		if( !( hitEvent ) )
		{
			return;
		}
		damage = hitEvent.attackComputed.GetTotalAttackValue( gamedataStatPoolType.Health );
		if( damage > 0.0 )
		{
			hitDirectionInt = GameObject.GetAttackAngleInInt( hitEvent );
			if( ( hitDirectionInt >= 1 ) && ( hitDirectionInt <= 3 ) )
			{
				statsSystem = GameInstance.GetStatsSystem( hitEvent.target.GetGame() );
				armorPoints = statsSystem.GetStatValue( hitEvent.target.GetEntityID(), gamedataStatType.Armor );
				effectiveHealthPerArmorPoint = GameInstance.GetStatsDataSystem( hitEvent.target.GetGame() ).GetArmorEffectivenessValue( hitEvent.target.IsPlayer() );
				hitEvent.attackComputed.MultAttackValue( 1.0 / ( 1.0 + ( ( armorPoints * effectiveHealthPerArmorPoint ) * m_armorMultiplier ) ) );
			}
		}
	}

}

