This is actually a badly done ability that I need to rewrite one of these days, but it's function is quite proper.
AbilityIonTorpedo
buffInstantActionType "ApplyTargettedBuffToSelf"
instantActionTriggerType "AlwaysPerform"
buffType "BuffIonTorpedoCharging"
This instant action type provides a target filter in the ability file, for purposes of having a targeted(I'm amazed I can still spell this right) ability. No filter in the ability, no target selection. The buff, as implied by the wording, applies to self, not the target.
BuffIonTorpedoCharging is simply a delay mechanism for effects and function.
buffInstantActionType "ApplyTargettedBuffToSelfNoFilterNoRange"
instantActionTriggerType "OnDelay"
delayTime 5.000000
buffType "BuffIonTorpedoActivated"
5 seconds of channeled, interruptable inactivity before BuffIonTorpedoActivated is triggered, once again, on self. This works off the original filter applied by AbilityIonTorpedo.
BuffIonTorpedoActivated is where the action begins.
buffInstantActionType "ApplyBuffToTargetWithTravelNoFilterNoRange"
instantActionTriggerType "AlwaysPerform"
buffType "BuffIonTorpedoDamage"
BuffIonTorpedoDamage is the only file that is ever applied to the target. It has no stacking limit.
finishCondition
finishConditionType "TargetOwnerIsFriendly"
This is completely useless since it's on what amounts to an instant action. It's residence in the charging buff however is proper design. What it does is end the buff if your target changes to your side. For instance, you're the Borg and you convert the target while a charging ability is still charging.
It's terribly inefficient, but it does function properly. There were a few oddities in behavior that someone hadn't worked out, so there are several of these strangely done abilities in here. Eventually I'll get around to optimizing them, but it's almost entirely irrelevant beyond minimizing the confusion of those that go poking through the files. All of them put together don't add as much cpu load to the game as a single trade ship.