So I have a little combinatorics question. Certain units in a game I have been playing recently have a system where you get to choose 'modules' to put in them. Those units are allowed to have a fixed number of modules (that is, you must choose exactly $n$ modules). The modules have several types, but the interesting thing is, you are often allowed to have more than one of the same type of module (with additional effects for doing so), but at the same time, there is usually a limit less than $n$ for how many of a given module can be put into the unit. So the question I have is:
How to count the possibilities? For instance, consider the example of a unit called a Cube:
It has 6 modules.
Up to 1 of which may be a Beam module
Up to 3 of which may be Torpedo modules
Up to 1 of which may be Regeneration modules
Up to 3 of which may be Holding Beam modules
Up to 2 of which may be Tactical Armor modules
So we get to choose a total of 6, but can have multiples. For example, you have have 1 beam, 3 torps, 1 regen, and 2 tac armor, or you could have 1 regen, 3 holding beam, and 2 tac armor. Though brute force counting, I have determined that there are 34 distinct possibilities (module order does not matter, but amount per type does), but I wanna know how to figure that out, in general, using combinatorics rather than straight counting the possibilities.