Code: Select all
A chameleon attacks a piece the way the piece attacks it. Hence, a chameleon captures a piece the way it captures it.
I think the Ultima Chameleon is not a pure Chameleon (i.e. one satisfying the quote), because it can leap-capture on the way to making a capture f a non-leap-capturer. I therefore wonder if it is a good idea to try to generalize it. A pure Chameleon should not be allowed to capture non-leapers when leaping.
A pure Chameleon would be easy to generalize. To generate its captures you would run through the opponent's piece list, and for any piece you encounter do a capture test of a fictitious piece of that type of your own at the square of the Chameleon to the opponent piece. That is not excessively costly. An added observaton is that replacement captures are mandatory, while all other captures are optional. (I.e. even when you could not make the capture, you are still allowed to make the move, leaving the would-be victimstanding there.)
Another fundamental question is how to treat leap-capturing riders. (A rider is piece that repeats its basic step like a slider, where the basic step is not to a neighbor square.) Most logical would be if a leap-capturing Nightrider could only capture pieces on squares it could land on. A leap-capturing Alfil-rider should not capture d2 if it jumps from c1 to e3.
When a pure Chameleon would capture a Xiangqi Cannon, it would need to jump over a platform. It could do that whatever the platform is. But if the platform is an enemy leap-capturer, a pure Chameleon could not capture it at the same time, because when you would replace it by the leap capturer, it would not have been allowed to move to the square occupied by the Cannon.