There is not, as far as I'm aware, but I've been toying with a turret-based playstyle for a while. Reading this motivated me to try writing some preliminary code today, and I have something that might be called a functioning turret (using placeholder sprites). Here's a basic rundown of how they work so far:
Using a consumable throwing item, you toss an inactive turret (maybe a capsule or something? Just using the handgun sprite for everything right now).
When this hits a tile, it activates, creating a turret at that position. The turret lasts for 30 seconds, and when it times out it turns back into the item you threw.
When there are no nearby targets it can see, the turret slowly rotates as if searching (this is working, but it looks awkward without a good sprite). The base of the turret remains still.
When a target enters its range/LoS, the turret aims at the target and fires bullets at a given rate.
These bullets are taken from the player's inventory. This allows the turret to use all kinds of bullets, just like the player with any gun. For the sake of flexibility, the turrets use ammo starting from the bottom ammo slot first, allowing you to, say, have turrets firing from an endless pouch while you use more expensive ammo for your gun. If no ammo is available, the turret will not fire, and will simply track the target.
If the target leaves its range/LoS or dies, it finds a new target.
The bullets fired by turrets use (turret base damage + ammo base damage) * player ranged damage as the damage formula.
And that's all I have done so far. Since it's not balanced to have a limitless number of turrets out at once, I'll probably tie them to minion slots or a separate custom parameter. The framework will easily allow for turrets that use different ammo, like rockets, arrows, and darts, as well as different firing styles (shotgun, burst, etc.)
What do you think? Anything seem weird, or anything it's missing? Once I have this polished up, get a full progression of turrets, and have sprites done (if I ever get someone to sprite for me
), the plan is to add this into the loot pool for my mod.
Edit: Forgot to mention that I have a simple target-leading system in place, where the turret calculates its firing angle based on the distance of the target, its velocity, and the speed at which the turret shoots. If an enemy moves at a constant velocity it should always hit dead center.