class WeaponItemTypeHitPrereqCondition extends BaseHitPrereqCondition
{
	var m_itemType : gamedataItemType;

	public override function SetData( recordID : TweakDBID )
	{
		var str : String;
		str = TweakDBInterface.GetString( recordID + T".weaponItemType", "" );
		m_itemType = ( ( gamedataItemType )( ( ( Int32 )( EnumValueFromString( "gamedataItemType", str ) ) ) ) );
		super.SetData( recordID );
	}

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var result : Bool;
		var objectToCheck : weak< WeaponObject >;
		var itemType : gamedataItemType;
		objectToCheck = ( ( WeaponObject )( hitEvent.attackData.GetWeapon() ) );
		if( objectToCheck )
		{
			itemType = WeaponObject.GetWeaponType( objectToCheck.GetItemID() );
			result = itemType == m_itemType;
			if( result )
			{
				result = CheckOnlyOncePerShot( hitEvent );
			}
			return ( ( m_invert ) ? ( !( result ) ) : ( result ) );
		}
		return false;
	}

}

