Merge pull request #305 from teeebor/feature/solitaire-and-blackjack-flipper-score

Solitaire and Blackjack now affect Flipper's level
This commit is contained in:
MX 2023-02-02 12:55:00 +03:00 committed by GitHub
commit 26b5b7e406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -278,6 +278,7 @@ void dealer_tick(GameState* game_state) {
if(dealer_score >= DEALER_MAX) { if(dealer_score >= DEALER_MAX) {
if(dealer_score > 21 || dealer_score < player_score) { if(dealer_score > 21 || dealer_score < player_score) {
DOLPHIN_DEED(DolphinDeedPluginGameWin);
enqueue( enqueue(
&(game_state->queue_state), &(game_state->queue_state),
game_state, game_state,
@ -570,6 +571,7 @@ int32_t blackjack_app(void* p) {
gui_add_view_port(gui, view_port, GuiLayerFullscreen); gui_add_view_port(gui, view_port, GuiLayerFullscreen);
AppEvent event; AppEvent event;
DOLPHIN_DEED(DolphinDeedPluginGameStart);
for(bool processing = true; processing;) { for(bool processing = true; processing;) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100); FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);

View File

@ -277,6 +277,7 @@ void tick(GameState* game_state, NotificationApp* notification) {
if(game_state->state == GameStatePlay) { if(game_state->state == GameStatePlay) {
if(game_state->top_cards[0].character == 11 && game_state->top_cards[1].character == 11 && if(game_state->top_cards[0].character == 11 && game_state->top_cards[1].character == 11 &&
game_state->top_cards[2].character == 11 && game_state->top_cards[3].character == 11) { game_state->top_cards[2].character == 11 && game_state->top_cards[3].character == 11) {
DOLPHIN_DEED(DolphinDeedPluginGameWin);
game_state->state = GameStateAnimate; game_state->state = GameStateAnimate;
return; return;
} }
@ -490,6 +491,8 @@ int32_t solitaire_app(void* p) {
gui_add_view_port(gui, view_port, GuiLayerFullscreen); gui_add_view_port(gui, view_port, GuiLayerFullscreen);
AppEvent event; AppEvent event;
DOLPHIN_DEED(DolphinDeedPluginGameStart);
for(bool processing = true; processing;) { for(bool processing = true; processing;) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 150); FuriStatus event_status = furi_message_queue_get(event_queue, &event, 150);
GameState* localstate = (GameState*)acquire_mutex_block(&state_mutex); GameState* localstate = (GameState*)acquire_mutex_block(&state_mutex);