Ah, I see that I forgot the # that GAME code requires to access variables in a few places. The extra Pre-Game code should really be:
set b1 findpiece B first spaces;
set b2 findpiece B last spaces;
if & 1 - file #b1 file #b2:
setflag #b1;
setflag #b2;
endif;
set b1 findpiece b first spaces;
set b2 findpiece b last spaces;
if & 1 - file #b1 file #b2:
setflag #b1;
setflag #b2;
endif;
This does fix the case where the Bishops already start on different shade, by setting them non-virgin so that their Wazir moves are suppressed.
But I was a bit too optimistic about the other case: it does hurt that you did not define a 'pure' Bishop amongst the piece types. Because when the Bishops are on the same shade, and you move the first one as a Wazir, the second one must be forced to move as a Bishop. But it is still virgin, so the move definition of the combi piece cannot be used for it. (It can be used as the definition of a pure Wazir, because it has the W moves after the B moves, so that you can give 124 as start index of the move list instead of 104 to skip the B moves.)
From the point we are now I guess the easiest way is to add the pure Bishop to the list by hand, making the end of the legdefs array look like
(5 lines inserted). The B and b functions then should refer to this pure Bishop when it needs one:
def B cond #0 (cond flag var ori 598 cond == 1 var wstart 598 cond var wstart 124 104) 0;
def b cond #0 (cond flag var ori 598 cond == 1 var bstart 598 cond var bstart 124 104) 0;
This then seems to do it.
Ah, I see that I forgot the # that GAME code requires to access variables in a few places. The extra Pre-Game code should really be:
This does fix the case where the Bishops already start on different shade, by setting them non-virgin so that their Wazir moves are suppressed.
But I was a bit too optimistic about the other case: it does hurt that you did not define a 'pure' Bishop amongst the piece types. Because when the Bishops are on the same shade, and you move the first one as a Wazir, the second one must be forced to move as a Bishop. But it is still virgin, so the move definition of the combi piece cannot be used for it. (It can be used as the definition of a pure Wazir, because it has the W moves after the B moves, so that you can give 124 as start index of the move list instead of 104 to skip the B moves.)
From the point we are now I guess the easiest way is to add the pure Bishop to the list by hand, making the end of the legdefs array look like
(5 lines inserted). The B and b functions then should refer to this pure Bishop when it needs one: