Unable to sleep and thinking about guns, I got to thinking about how a dwarf-made firearm might work. We've kind of established flintlock guns, which make a lot of sense until percussion explosives are invented. Note that percussion explosives are kind of the barrier to making any progress in the field of firearms and flintlocks were kinda used for hundreds of years so I don't know that is even plausible in this world.
Anyway, a flintlock mechanism involves having a spring-loaded flint held rearward by a mechanical arm, called the cock (hence the term "cocking the gun"). When the trigger is pulled, it releases the spring, causing the cock to fly forward on its hinge. The flint hits a striker, which causes hot pieces of the flint to shard off into a pan which catches the hot shards. There is powder in the pan; the hot shards of flint ignite the powder, which feeds into a tube carrying the main powder charge. When the burning powder reaches the main charge, the main charge ignites and shoots the bullet forward.
This is pretty inefficient, all things considered. First, flintlock rifles are bullshit. I don't mean like they didn't exist because they did, but in the real world they were a million and a half bitches to load and no one really used them, aside from hunters and military marksmen. There weren't even really "sharpshooters" back then; the term was coined from the Sharps rifle which kinda shoots .45-70 black powder cartridges. That's cartridges, like rounds, like made of brass with a jacketed bullet. Most flintlock guns of their day were muskets. A flintlock rifle takes about 50 times longer to reload because you have to forcibly slam the damn musket ball down the bore, so a musket, where you put the main charge in the bore, put the ball down the bore, put the powder in the pan, cock the action, sight in and shoot all in 20 seconds is a much more reasonable deal. If you want to narrow it down to 2 full-round actions to reload and another to sight in and fire (with appropriate reloading class features or feats) that would make sense. A rifle takes many times that because of the difficulty in getting that damn ball down the bore without damaging the bore.
BUT FUCK THAT.
So dwarves are a little bit smarter than that, with paper cartridges that hold the main charge. How can we best use that technology?
The best way to use a paper cartridge is in a two-piece load. You pull the smaller piece of the cartridge off and open it up, pouring the powder into the pan. The other piece of paper cartridge just feeds into the muzzle of the g...FUCK THAT TOO.
Instead of muzzle-fed bullshit, we can also improve there. The main charge is glued to the bullet itself, and the whole thing is fed into the breech. A break-action design simply won't work for a flintlock though; the pan and striker and trigger assembly are all kinda in one spot and you can't break that open. Instead, a falling block action can be used to feed the paper cartridge + bullet into the chamber. What's a falling block action?
Modern bolt-actions are held in place by locking lugs, which rotate when the bolt is turned to seat the bolt so that it can't move. In fact, bolt-action rifles have multiple locking lugs to distribute stress on them between several points of contact so a high-powered rifle cartridge doesn't break them. It is possible that a bolt-action, chamber-fed gun is the next step in dwarven firearms evolution but really the improvements would be minimal compared to a falling block action.
The main flaws in this design are the problems with any unjacketed lead bullet fired through a rifled barrel; lead and propellant fouling in the barrel and paper/propellant fouling in the chamber. The advantages though are a gun that can probably be reloaded as a standard action or possibly even a move action. There's probably severe accuracy problems if you fire more than 3-4 shots without cleaning it though.
The actual bullet itself has a lot of potential from this design. You can make an actual bullet, rather than a lead ball, though actual spitzer bullets weren't invented until the 20th century IRL and were only really feasible with jacketed bullets anyway which is totally not something that would be invented anytime soon. Even without a real bullet, you can squeeze a ton more accuracy out of this. The chamber is mostly airtight, except for the pan (not sure how that problem was solved), but more importantly the bullet is slightly bigger than the bore so the bullet flies perfectly straight down the barrel, swaged by the rifling for amazing accuracy, relative to its predecessors. Reloading this sucker is super fast too. Operate the lever, put the bullet and main charge in, break the paper for the secondary charge in the pan, close the lever, cock the gun and sight in. Probably a standard action with a feat or class ability to improve it to a move action.
These rifles would be useful for infantry with some caveats. The main issue is that massed fire of black powder weapons creates a lot of smoke, especially flintlocks that burn powder in a pan outside the rifle. However, other elements of D&D warfare kind of render infantry formations stupid; the military adoption of the fireball, grease, and entangle ordinance make massed infantry a really bad idea. Most likely, infantry operate in squads with a unit commander and individual objective orders, with squad leaders, team leaders, and specialists assigned as needed. Unfortunately in D&D, magic was invented before the radio. How does siege warfare even get done? I'm not really sure. The ability to conjure also has issues since it's harder to starve an army of provisions and nearly impossible to run it out of water, even in desert combat.
My guess is that you just don't attack fortifications in D&D unless you want your siege weapons getting wrecked by scorching ray snipers.