Rev 86 | Rev 119 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 86 | Rev 116 | ||
---|---|---|---|
Line 251... | Line 251... | ||
251 | // else is it an *irrevocable* draw ? (at this point there's nothing we can do but accept it) |
251 | // else is it an *irrevocable* draw ? (at this point there's nothing we can do but accept it) |
252 | else if (wcsstr (line_buffer, L"1/2-1/2") != NULL) |
252 | else if (wcsstr (line_buffer, L"1/2-1/2") != NULL) |
253 | { |
253 | { |
254 | Debug_Log (L"===Engine tells us that it's a draw: nobody wins!===\n"); |
254 | Debug_Log (L"===Engine tells us that it's a draw: nobody wins!===\n"); |
255 | 255 | ||
256 | // play defeat sound (a draw is always a sort of defeat...) |
256 | // play defeat sound (a draw is always a sort of defeat...) at the center of the board |
257 | Audio_PlaySound ( |
257 | Audio_PlaySound (SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
258 | 258 | ||
259 | // display the game over dialog box |
259 | // display the game over dialog box |
260 | the_board.game_state = STATE_DRAW_OTHER; |
260 | the_board.game_state = STATE_DRAW_OTHER; |
261 | DialogBox_EndGame (); |
261 | DialogBox_EndGame (); |
262 | 262 | ||
Line 267... | Line 267... | ||
267 | // else is the engine *irrevocably* resigning ? (at this point there's nothing we can do but accept it) |
267 | // else is the engine *irrevocably* resigning ? (at this point there's nothing we can do but accept it) |
268 | else if (wcsncmp (line_buffer, L"resign", 6) == 0) |
268 | else if (wcsncmp (line_buffer, L"resign", 6) == 0) |
269 | { |
269 | { |
270 | Debug_Log (L"===Engine tells us that %s resigns: %s wins!===\n", (current_player->color == COLOR_BLACK ? "black" : "white"), (current_player->color == COLOR_BLACK ? "white" : "black")); |
270 | Debug_Log (L"===Engine tells us that %s resigns: %s wins!===\n", (current_player->color == COLOR_BLACK ? "black" : "white"), (current_player->color == COLOR_BLACK ? "white" : "black")); |
271 | 271 | ||
272 | // if opponent player is human, play the victory sound, else, play defeat sound |
272 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
273 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : |
273 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
274 | 274 | ||
275 | // display the game over dialog box |
275 | // display the game over dialog box |
276 | the_board.game_state = (current_player->color == COLOR_BLACK ? STATE_WHITEWIN_RESIGNORFORFEIT : STATE_BLACKWIN_RESIGNORFORFEIT); |
276 | the_board.game_state = (current_player->color == COLOR_BLACK ? STATE_WHITEWIN_RESIGNORFORFEIT : STATE_BLACKWIN_RESIGNORFORFEIT); |
277 | DialogBox_EndGame (); |
277 | DialogBox_EndGame (); |
278 | 278 | ||
Line 291... | Line 291... | ||
291 | current_obstinacy++; // if so, discard this resign and go on |
291 | current_obstinacy++; // if so, discard this resign and go on |
292 | else |
292 | else |
293 | { |
293 | { |
294 | Debug_Log (L"===Engine tells us that black resigns: white wins!===\n"); |
294 | Debug_Log (L"===Engine tells us that black resigns: white wins!===\n"); |
295 | 295 | ||
296 | // if opponent player is human, play the victory sound, else, play defeat sound |
296 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
297 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : |
297 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
298 | 298 | ||
299 | // display the game over dialog box |
299 | // display the game over dialog box |
300 | the_board.game_state = STATE_WHITEWIN_RESIGNORFORFEIT; |
300 | the_board.game_state = STATE_WHITEWIN_RESIGNORFORFEIT; |
301 | DialogBox_EndGame (); |
301 | DialogBox_EndGame (); |
302 | 302 | ||
Line 312... | Line 312... | ||
312 | current_obstinacy++; // if so, discard this resign and go on |
312 | current_obstinacy++; // if so, discard this resign and go on |
313 | else |
313 | else |
314 | { |
314 | { |
315 | Debug_Log (L"===Engine tells us that white resigns: black wins!===\n"); |
315 | Debug_Log (L"===Engine tells us that white resigns: black wins!===\n"); |
316 | 316 | ||
317 | // if opponent player is human, play the victory sound, else, play defeat sound |
317 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
318 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : |
318 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
319 | 319 | ||
320 | // display the game over dialog box |
320 | // display the game over dialog box |
321 | the_board.game_state = STATE_BLACKWIN_RESIGNORFORFEIT; |
321 | the_board.game_state = STATE_BLACKWIN_RESIGNORFORFEIT; |
322 | DialogBox_EndGame (); |
322 | DialogBox_EndGame (); |
323 | 323 |