Mirror is a simple mod that reflects most vanilla weapons, based on where they're installed on your ship. In general, weapons will be mirrored if they are to the left of the ship's centerline and facing forwards, or if they're to the right of the ship's centerline and facing backwards.
DecoLib is the library mod that contains the actual code for mirroring weapons, and is required for Mirror.
F.A.Q.
Q: Why the frogwaffles is this distributed as two separate mods?
A: Separating out DecoLib into its own thing makes it easy for other modders to establish a dependency on it, using its code without mandating that the player use Mirror. (Also, I've got plans for DecoLib; it's supposed to be a lot more than it currently is. There's a reason its version number started at 0.1 and not 1.0. Presumably it'll get its own thread at some point.)
Q: So, uh, what about weapons that are on the centerline, or that are facing directly left or right?
A: In general, 'on the centerline' counts as 'right', and facing directly left/right counts as 'forward' - however, there are no guarantees. Sometimes a weapon mount might look as if it's on the centerline, but it isn't exactly. Similarly, weapons that appear to be facing directly left or right may not have the expected value for 'forwardsness'. I've added a 0.1 degree fudge factor to account for some ORA hulls having weapon mounts that look like they're facing directly to the side, but are actually pointed a tiny fraction of a degree backwards. If you've got a specific example of this code doing the 'wrong' thing, let me know, and I'll see what I can do about it.
Q: Why didn't you mirror vanilla weapon X?
A: Probably just forgot about it - I didn't mirror literally everything, just the weapons where I thought it might matter. If you think there's something I missed, let me know and I'll take a look.
Q: Why did you mirror weapons like the Mjolnir? That's already symmetrical!
A: It's subtle, but try putting two Mjolnir cannons on a Dominator with linked fire. Vanilla behavior has them firing their left barrels, then their right barrels, then left again, etc. With mirroring active, they instead fire outside barrels, then inside barrels, etc. (Of course, in actual combat, this can easily get out of sync. Still, I think it's a neat effect.)
Q: Why didn't you mirror mod-added weapon Y?
A: First, it's rude to make a mod that changes the behavior of other people's mods. Second, if I made this mirror weapons from some other mod, I'd need to also make this depend on that other mod, and that'd be extraordinarily inconvenient for anyone who doesn't run with that other mod. So, no, I will not be mirroring mod-added weaponry.
Q: So... how hard is it for someone else to mirror mod-added weaponry?
A: Nothing in Mirror is deliberately obfuscated. If you're a mod author and want to use DecoLib to mirror your own weaponry - it should be pretty easy to figure out how to do that, and you're welcome to ask me for help if you need it. If you're not a mod author, and want to create a personal mod to mirror specific weapons... well, that could be a bit trickier.
Q: Hey, I made this mod that mirrors someone else's mod-added weaponry! Could you put a link to it in your post?
A: No. See: it's rude to make a mod that changes the behavior of other people's mods. You are welcome to construct such mods for your own personal use (as long as you understand that you're basically voiding the warranty - mod authors will be understandably upset if you report a bug with 'their' mod and it turns out to be something you broke in your own personal tinkering), but you are not welcome to distribute such mods. (Unless, of course, you have explicit permission from the original mod's author, in which case distribute away.)
Q: Can I translate this into some other language and cross-post it on a non-english Starsector forum?
A: Feel free! Just do give me credit, and link back here from wherever you put it up, and drop a link from here to wherever you put it, too - I'm curious. (Exception: If posting a link to where you put it would violate forum rules, then you do not have permission to put the mod there in the first place. I don't expect this exception to come up, but I'm stating it here for the record anyway.)
provided the prototype for being able to do this at all.
most* contexts.