Implement king alt move on server.

This commit is contained in:
yukirij 2025-02-05 18:02:09 -08:00
parent 911a1590e4
commit 9e0e6bd3cc
2 changed files with 21 additions and 1 deletions

View File

@ -637,6 +637,24 @@ impl Game {
}
}
}
// Hearth
3 => {
for target in &self.board.pieces {
if let Some(target) = target {
let tile = self.board.tiles[target.tile as usize];
if !tile.threat[!target.player as usize] && target.blocking == 0 {
plays.push(PlayInfo {
valid: true,
threat: false,
play: Play::from_alt(piece.tile, target.tile),
check: CheckState::new(),
blocking: 0,
});
}
}
}
}
_ => { }
}

View File

@ -125,7 +125,9 @@ pub const PIECES :[PieceClass; PIECES_COUNT] = [
name: "Heart",
moves: MoveSet::new()
.add(bit(0) | bit(1) | bit(2) | bit(3) | bit(4) | bit(5) | bit(7) | bit(10)),
pmoves: MoveSet::new(),
pmoves: MoveSet::new()
.add(bit(0) | bit(1) | bit(2) | bit(3) | bit(4) | bit(5) | bit(7) | bit(10))
.add_alt(3),
},
];