Gang rapes never happen when a battle ends, because the game checks if "person.sexuals.unlocked" is true. That flag belongs to the old sex system, though: in the latest releases it is always false.
In exploration.gd, that string should be replaced with "person.consent" if I am not mistaken (note: there are two occurrences of that string).
Also, the code needs a clean-up, I think. The string "person.sexuals" appears in some other scripts, especially (but not only) in jobs&specs.gd.