In some variants the move options of a piece can depend on its location on the board. (In fact the orthodox Pawn's double push can be considered an example of this, especially in Crazyhouse where it is not tied to the first move, but can be regained by returning to 2nd rank by means of a drop.) One way to implement this would be to invoke hidden promotions, where the piece is internally represented by several piece types, which 'promote' to each other in the applicable location to get the desired move from there.
But in FSF an alternative method might be much easier to implement. Since moves are generated by table lookups indexed by square, moves from different squares are independent from each other in a natural way. E.g. a piece that moves as a Knight on light squares, and as a King on dark squares, could get a leaperAttacks table of bitboards picked from the Knight tables on light squares, and from the King tables on dark squares.
To implement that there could be a directive in the variants.ini file that would specify two piece types and a list of squares. This would then cause the move tables (such as leaperAttacks, pseudoAttacks) of the first-mentioned type to be overwritten by those of the second type at each of the listed squares.
For riders this is not entirely perfect, as the RiderTypes used by each piece type are specified globally (i.e. for all squares at the same time). Nevertheless, they can be suppressed by the pseudoAttacks and pseudoMoves tables. A piece that moves as Knight on light squares and as Rook on the dark squares could specify the Rook_H and Rook_V rides as rider types, but the pseudoAttacks would mask those away for the squares where the piece would move as a Knight. This is not very efficient, since the orthogonal rides would still be calculated, only to be discarded. But, as the proverb says: "better expensive than unavailable".
So the directive would OR the RiderTypes for the mentioned piece types, and pick the masks that are defined per square according to the mentioned square.
Repeated application of the directive on the same piece types could diversify the move over arbitrarily many zones.
In some variants the move options of a piece can depend on its location on the board. (In fact the orthodox Pawn's double push can be considered an example of this, especially in Crazyhouse where it is not tied to the first move, but can be regained by returning to 2nd rank by means of a drop.) One way to implement this would be to invoke hidden promotions, where the piece is internally represented by several piece types, which 'promote' to each other in the applicable location to get the desired move from there.
But in FSF an alternative method might be much easier to implement. Since moves are generated by table lookups indexed by square, moves from different squares are independent from each other in a natural way. E.g. a piece that moves as a Knight on light squares, and as a King on dark squares, could get a leaperAttacks table of bitboards picked from the Knight tables on light squares, and from the King tables on dark squares.
To implement that there could be a directive in the variants.ini file that would specify two piece types and a list of squares. This would then cause the move tables (such as leaperAttacks, pseudoAttacks) of the first-mentioned type to be overwritten by those of the second type at each of the listed squares.
For riders this is not entirely perfect, as the RiderTypes used by each piece type are specified globally (i.e. for all squares at the same time). Nevertheless, they can be suppressed by the pseudoAttacks and pseudoMoves tables. A piece that moves as Knight on light squares and as Rook on the dark squares could specify the Rook_H and Rook_V rides as rider types, but the pseudoAttacks would mask those away for the squares where the piece would move as a Knight. This is not very efficient, since the orthogonal rides would still be calculated, only to be discarded. But, as the proverb says: "better expensive than unavailable".
So the directive would OR the RiderTypes for the mentioned piece types, and pick the masks that are defined per square according to the mentioned square.
Repeated application of the directive on the same piece types could diversify the move over arbitrarily many zones.