From dafdcb8596f64b9fb38375e6c80a2ec2b3705a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Beckh=C3=A4user?= Date: Tue, 17 Sep 2019 21:49:18 +0200 Subject: [PATCH] Rework of the Descent 2 final boss fade-to-black effect introduced in 5b18219aac4dd535e2803de9310ba26dfa7acc28: In the original game the silent 2 second countdown would lapse before the screen faded to black. In restoration, it would fade to black as the countdown started. This rework fixes this discrepancy. --- similar/main/collide.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/similar/main/collide.cpp b/similar/main/collide.cpp index 9b4ce0fab..18253c5f5 100644 --- a/similar/main/collide.cpp +++ b/similar/main/collide.cpp @@ -1353,8 +1353,11 @@ window_event_result do_final_boss_frame(void) Final_boss_countdown_time -= FrameTime; if (Final_boss_countdown_time > 0) { - int flash_value = f2i(((F1_0*2)-Final_boss_countdown_time)*16); // countdown is 2 seconds (as set by do_final_boss_hacks()), so make a flash value that maxes out over that time - PALETTE_FLASH_SET(-flash_value,-flash_value,-flash_value); // set palette to inverted flash_value to fade to black + if (Final_boss_countdown_time <= F1_0*2) + { + int flash_value = f2i(((F1_0*2)-Final_boss_countdown_time)*16); // during final 2 seconds of final boss countdown (as set by do_final_boss_hacks()), make a flash value that maxes out over that time + PALETTE_FLASH_SET(-flash_value,-flash_value,-flash_value); // set palette to inverted flash_value to fade to black + } GameUniqueState.Final_boss_countdown_time = Final_boss_countdown_time; return window_event_result::ignored; } @@ -1402,7 +1405,7 @@ void do_final_boss_hacks(void) if (!(Game_mode & GM_MULTI)) buddy_message("Nice job, %s!", static_cast(get_local_player().callsign)); - GameUniqueState.Final_boss_countdown_time = F1_0*2; + GameUniqueState.Final_boss_countdown_time = F1_0*4; // was F1_0*2 originally. extended to F1_0*4 to play fade to black which happened after countdown ended in the original game. } }