If I'm reading your question correctly (which is not guaranteed: I've read through it a half-dozen times, and I'm still not 100% sure I've got it, but maybe that's what afternoon naps on snowy days do...), then the solution-function is almost the same as Ilmari's answer from the linked post. The only change is what to do in case of a tie. (Nothing special!)
function: A:s vs B:s {
result: (A > 1@B) - (B > 1@A)
}
Recall that a group of dice stored as a sequence (A:s
) automatically sorts high-to-low and elements are @-accessed, so 1@A
outputs the first (i.e. highest) roll of group A. The comparison operator acting on a sequence vs. a number will generate a truth-count as its output, so A>1@B
produces "the number of rolls in A greater than the highest of B". And in the case of a tie, we know (by construction) that A>1@B
and B>1@A
will both be zero, so we get the result you want =)
Function defined, if you want to see it in action a simple call like
output [6d6 vs 4d6] named "6 vs 4"
or
loop X over {3..6} {
output [Xd6 vs 4d6] named "[X]d6 vs 4d6"
}
will do the trick. It's pretty time-intensive, though, so you may end up running lots of "combats" individually.
I will be donating all rep from this answer to a post of Ilmari's choice or, absent such a choice, to a post of Ilmari's that I choose (via bounty). Because this code is basically just theirs, with one tweak to fit your tie-condition.