From eb90648bdad1443c9cfc72e903a93642e10a0ab7 Mon Sep 17 00:00:00 2001 From: scratko Date: Fri, 16 Aug 2024 18:10:11 +0300 Subject: Global fixes v2.0 Added spectator mode. Added screen of game result. Added definition of durak. If not all players can replenish their decks, they take cards one at a time in turn. --- client/printing_game_frames.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'client/printing_game_frames.c') diff --git a/client/printing_game_frames.c b/client/printing_game_frames.c index f75cec5..5c7deac 100644 --- a/client/printing_game_frames.c +++ b/client/printing_game_frames.c @@ -3,6 +3,14 @@ #include +void pgf_new_frame() +{ + int i; + + for(i = 0; i < 25; ++i) + printf("\n"); +} + void pgf_first_player() { printf("=======================================\n" @@ -54,7 +62,8 @@ void pgf_table(struct client *cl) printf("\n"); deck = deck->next; } - printf("\n"); + if(cl->deck) + printf("\n"); } void pgf_suggestions(struct client *cl) @@ -104,3 +113,24 @@ void pgf_tossing_limit_status() printf("the cards were not accepted.\n" "The other players have already tossed cards.\n"); } + +void pgf_spectator_mode(enum spectator_mode sp_mode) +{ + printf("spectator mode\n"); + if(sp_mode == spectator_attack) + printf("attacker makes a move\n"); + else if(sp_mode == spectator_defense) + printf("defender make a move\n"); + else if(sp_mode == spectator_tossing) + printf("players toss in extra cards\n"); + else + printf("round result\n"); +} + +void pgf_game_result(int durak_position) +{ + printf("===============================\n" + " END OF GAME\n" + "player under number %u is durak\n" + "===============================\n", durak_position); +} -- cgit v1.2.3