I'm trying to create a hullmod that either buffs the ship's torpedo-type missiles only, or forbids equipping missiles other than torpedoes, but I find myself stumped. Any advice on how (or if) this can be achieved?
There isn't, as far as I know, a "torpedo" classification. They're all missiles. I believe vanilla ones have the STRIKE tag, but other weapons have that too. But depending on what you want to buff or the effect you want to achieve, you can probably check by taking a list of all missiles in the map and seeing if they have "Torpedo" in their name, I guess.
Right, yeah - unfortunately, the methods involved are not exposed, and if they were, there's no mechanism to buff certain weapons that selectively. In the next release, there'll be a "WeaponOPCostModifier" you can add to a ship's stats (generally via a built-in hullmod) that would be able to make fine-grained distinctions like this, though you'd *still* have to figure out in some way whether a weapon is a torpedo or not.
How can I trigger nearby patrols to inspect the player fleet? Also is there a reference I could look up to define something as illegal when the ship's player is inspected?
Just roughly, you'd give the patrol fleet an intercept assignment with whatever text override was appropriate. And... you'd have to do *something* to make it actually do a customs inspection - there are rules regarding this in rules.csv; I forget exactly what the trigger is, you can look at the tOffPatrolBeginNoTalk rule and the ones around there. As far as what's illegal, that would be defined in the faction's file. You could also re-rig the entire interacton via rules if you need something truly custom, if it's worth the effort.
Is there a way to determine whether the battle is a regular battle or a fleet pursuit? Or more generally, where a given ship's retreat plane is? For example, if I want the AI to only activate a system when pointed in the direction of retreat.
CombatFleetManagerAPI.getGoal() - then, based on that and the side (player or enemy) you're looking at, it's either up or down.