if == k #victim:
set p search pr $space;
add k #p;
endif;
at the end of the Post-Move 1 section, to take care of black's Prince promoting to King when white captures the black King.
[Edit] This did not work; apparently the search operator cannot operate on a system variable like $space. So you have to copy that first:
if == k #victim:
set brd $space;
set p search pr #brd;
add k #p;
endif;
When I do get into the heavy editing: Do you think it'd matter whether the #victim test or the Helepolis test is done first?
In the code it would probably be easier to do the Helepolis move before the succession test, because the succession then can also take care of the case where the Helepolis did overrun the King. If you encounter a King in thr process of removing the locust victims you could set victim to k, so that the succession code is later triggered. Unfortunately you have to prepare for the case that K and Q can be captured on the same move, and you cannot set victim to K and Q at the same time. This could be solved by making a copy of victim (set v2 #victim;), and use that for testing the Queen succession; the Helepolis code can then set victim to K and v2 to Q when it encounters any of those, without spoiling succession of the other.
I guess you would need something like:
at the end of the Post-Move 1 section, to take care of black's Prince promoting to King when white captures the black King.
[Edit] This did not work; apparently the search operator cannot operate on a system variable like $space. So you have to copy that first:
In the code it would probably be easier to do the Helepolis move before the succession test, because the succession then can also take care of the case where the Helepolis did overrun the King. If you encounter a King in thr process of removing the locust victims you could set victim to k, so that the succession code is later triggered. Unfortunately you have to prepare for the case that K and Q can be captured on the same move, and you cannot set victim to K and Q at the same time. This could be solved by making a copy of victim (set v2 #victim;), and use that for testing the Queen succession; the Helepolis code can then set victim to K and v2 to Q when it encounters any of those, without spoiling succession of the other.