WIP
This commit is contained in:
@@ -113,7 +113,7 @@ class Player {
|
||||
await this.board.frame(position, this.game.header);
|
||||
this.board.render();
|
||||
|
||||
if (state.boardConfig.speech) {
|
||||
if (this.ply > 0 && state.boardConfig.speech) {
|
||||
this.speech.say(sanToText(position.move?.san as string));
|
||||
}
|
||||
|
||||
@@ -128,6 +128,19 @@ class Player {
|
||||
sfx.move.play();
|
||||
}
|
||||
}
|
||||
|
||||
if (position.end === 0) {
|
||||
const result = this.game.header.Result;
|
||||
if (result) {
|
||||
this.speech.say(
|
||||
result === "1-0"
|
||||
? "White wins!"
|
||||
: result === "0-1"
|
||||
? "Black wins!"
|
||||
: "Draw"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async first() {
|
||||
|
||||
Reference in New Issue
Block a user