class WeaponTypeHitPrereqCondition extends BaseHitPrereqCondition
{
	var m_type : CName;

	public override function SetData( recordID : TweakDBID )
	{
		m_type = TweakDBInterface.GetCName( recordID + T".weaponType", '' );
		super.SetData( recordID );
	}

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var result : Bool;
		var objectToCheck : weak< WeaponObject >;
		objectToCheck = ( ( WeaponObject )( hitEvent.attackData.GetWeapon() ) );
		if( objectToCheck )
		{
			switch( m_type )
			{
				case 'Melee':
					result = objectToCheck.IsMelee();
				break;
				case 'Ranged':
					result = objectToCheck.IsRanged();
				break;
				case 'Shotgun':
					result = objectToCheck.IsShotgun();
				break;
				default:
					return false;
			}
			if( result )
			{
				result = CheckOnlyOncePerShot( hitEvent );
			}
			return ( ( m_invert ) ? ( !( result ) ) : ( result ) );
		}
		return false;
	}

}

