From 82b65c87b841167f70cf27fa7300b7f9ef156c7c Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 3 Nov 2019 10:29:42 -0500 Subject: [PATCH] Alacroix title screen character frames --- src/f_finale.c | 594 +++++++++++++++++++++++++++++++++++++++++++++++-- src/f_finale.h | 2 +- 2 files changed, 572 insertions(+), 24 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 51572f573..9971a16e3 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -234,6 +234,22 @@ static patch_t *t6kndh[TTMAX_ALACROIX]; #define TTKNBK (presc == 6 ? t6knbk : presc == 4 ? t4knbk : presc == 2 ? t2knbk : t1knbk) #define TTKNDH (presc == 6 ? t6kndh : presc == 4 ? t4kndh : presc == 2 ? t2kndh : t1kndh) +static boolean sonic_blink = false; +static boolean sonic_blink_twice = false; +static boolean sonic_blinked_already = false; +static INT32 sonic_idle_start = 0; +static INT32 sonic_idle_end = 0; +static boolean tails_blink = false; +static boolean tails_blink_twice = false; +static boolean tails_blinked_already = false; +static INT32 tails_idle_start = 0; +static INT32 tails_idle_end = 0; +static boolean knux_blink = false; +static boolean knux_blink_twice = false; +static boolean knux_blinked_already = false; +static INT32 knux_idle_start = 0; +static INT32 knux_idle_end = 0; + // ttmode user static patch_t *ttuser[TTMAX_USER]; static INT32 ttuser_count = 0; @@ -2331,7 +2347,13 @@ void F_StartTitleScreen(void) if (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS) { - ttuser_count = 0; + ttuser_count =\ + sonic_blink = sonic_blink_twice = sonic_idle_start = sonic_idle_end =\ + tails_blink = tails_blink_twice = tails_idle_start = tails_idle_end =\ + knux_blink = knux_blink_twice = knux_idle_start = knux_idle_end = 0; + + sonic_blinked_already = tails_blinked_already = knux_blinked_already = 1; // don't blink on the first idle cycle + if (curttmode == TTMODE_ALACROIX) finalecount = -3; // hack so that frames don't advance during the entry wipe else @@ -2644,9 +2666,9 @@ void F_TitleScreenDrawer(void) break; case TTMODE_ALACROIX: - /* - ALICE ANIMATION CODE GOES HERE - */ + // + // PRE-INTRO: WING ON BLACK BACKGROUND + // // Start at black background. Draw it until tic 30, where we replace with a white flash. // @@ -2662,11 +2684,11 @@ void F_TitleScreenDrawer(void) if (finalecount <= 29) { // Ribbon unfurls, revealing SONIC text, from tic 0 to tic 24. SONIC text is pre-baked into this ribbon graphic. - V_DrawSciencePatch(40<= 0) - V_DrawSciencePatch(90< 9) @@ -2690,39 +2712,417 @@ void F_TitleScreenDrawer(void) case 4: case 3: fadeval = V_10TRANS; break; } } - V_DrawSciencePatch(80< 15) - V_DrawSciencePatch(107<= KNUXIDLE) + { + if (!knux_idle_start || !((finalecount - knux_idle_start) % knux_idle_end)) + { + if (knux_blink) + { + knux_blink = false; // don't run the cycle twice in a row + knux_blinked_already = true; + } + else if (knux_blinked_already) // or after the first non-blink cycle, either. + knux_blinked_already = false; + else + { + // make this chance higher than Sonic/Tails because Knux's idle cycle is longer + knux_blink = !(M_RandomKey(100) % 2); + knux_blink_twice = knux_blink ? !(M_RandomKey(100) % 5) : false; + } + knux_idle_start = finalecount; + } + + knux_idle_end = knux_blink ? (knux_blink_twice ? 17 : 7) : 46; + } + + if (finalecount >= TAILSIDLE) + { + if (!tails_idle_start || !((finalecount - tails_idle_start) % tails_idle_end)) + { + if (tails_blink) + { + tails_blink = false; // don't run the cycle twice in a row + tails_blinked_already = true; + } + else if (tails_blinked_already) // or after the first non-blink cycle, either. + tails_blinked_already = false; + else + { + tails_blink = !(M_RandomKey(100) % 3); + tails_blink_twice = tails_blink ? !(M_RandomKey(100) % 5) : false; + } + tails_idle_start = finalecount; + } + + // Tails does not actually have a non-blink idle cycle, but make up a number + // so he can still blink. + tails_idle_end = tails_blink ? (tails_blink_twice ? 17 : 7) : 35; + } + + if (finalecount >= SONICIDLE) + { + if (!sonic_idle_start || !((finalecount - sonic_idle_start) % sonic_idle_end)) + { + if (sonic_blink) + { + sonic_blink = false; // don't run the cycle twice in a row + sonic_blinked_already = true; + } + else if (sonic_blinked_already) // or after the first non-blink cycle, either. + sonic_blinked_already = false; + else + { + sonic_blink = !(M_RandomKey(100) % 3); + sonic_blink_twice = sonic_blink ? !(M_RandomKey(100) % 5) : false; + } + sonic_idle_start = finalecount; + } + + sonic_idle_end = sonic_blink ? (sonic_blink_twice ? 17 : 7) : 25; + } + // - // TODO: FRONT TAIL GFX GO HERE + // BACK TAIL LAYER // + if (finalecount >= TAILSSTART) + { + if (finalecount >= TAILSIDLE) + { + // + // Tails Back Tail Layer Idle + // + SINT8 taftcount = (finalecount - (TAILSIDLE)) % 41; + if (taftcount >= 0 && taftcount < 5 ) + V_DrawSciencePatch(TAILSX<= 5 && taftcount < 9 ) + V_DrawSciencePatch(TAILSX<= 9 && taftcount < 12 ) + V_DrawSciencePatch(TAILSX<= 12 && taftcount < 14 ) + V_DrawSciencePatch(TAILSX<= 14 && taftcount < 17 ) + V_DrawSciencePatch(TAILSX<= 17 && taftcount < 21 ) + V_DrawSciencePatch(TAILSX<= 21 && taftcount < 24 ) + V_DrawSciencePatch(TAILSX<= 24 && taftcount < 25 ) + V_DrawSciencePatch(TAILSX<= 25 && taftcount < 28 ) + V_DrawSciencePatch(TAILSX<= 28 && taftcount < 31 ) + V_DrawSciencePatch(TAILSX<= 31 && taftcount < 35 ) + V_DrawSciencePatch(TAILSX<= 35 && taftcount < 41 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART) + { + if (finalecount >= TAILSIDLE) + { + // + // Tails Front Tail Layer Idle + // + SINT8 tabtcount = (finalecount - (TAILSIDLE)) % 41; + if (tabtcount >= 0 && tabtcount < 6 ) + V_DrawSciencePatch(TAILSX<= 6 && tabtcount < 11 ) + V_DrawSciencePatch(TAILSX<= 11 && tabtcount < 15 ) + V_DrawSciencePatch(TAILSX<= 15 && tabtcount < 18 ) + V_DrawSciencePatch(TAILSX<= 18 && tabtcount < 19 ) + V_DrawSciencePatch(TAILSX<= 19 && tabtcount < 22 ) + V_DrawSciencePatch(TAILSX<= 22 && tabtcount < 27 ) + V_DrawSciencePatch(TAILSX<= 27 && tabtcount < 30 ) + V_DrawSciencePatch(TAILSX<= 30 && tabtcount < 31 ) + V_DrawSciencePatch(TAILSX<= 31 && tabtcount < 34 ) + V_DrawSciencePatch(TAILSX<= 34 && tabtcount < 37 ) + V_DrawSciencePatch(TAILSX<= 37 && tabtcount < 41 ) + V_DrawSciencePatch(TAILSX<= KNUXSTART) + { + if (finalecount < KNUXIDLE) + { + // + // Knux Back Layer Intro + // + if (finalecount >= KNUXSTART+0 && finalecount < KNUXSTART+6 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+6 && finalecount < KNUXSTART+10 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+10 && finalecount < KNUXSTART+13 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+13 && finalecount < KNUXSTART+15 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+15 && finalecount < KNUXSTART+18 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+18 && finalecount < KNUXSTART+22 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+22 && finalecount < KNUXSTART+28 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+28 && finalecount < KNUXSTART+32 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+32 && finalecount < KNUXSTART+35 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+35 && finalecount < KNUXSTART+40 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+40 && finalecount < KNUXSTART+41 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+41 && finalecount < KNUXSTART+44 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+44 && finalecount < KNUXSTART+50 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+50 && finalecount < KNUXSTART+56 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+56 && finalecount < KNUXSTART+57 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+57 && finalecount < KNUXSTART+60 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+60 && finalecount < KNUXSTART+63 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+63 && finalecount < KNUXSTART+67 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+67 && finalecount < KNUXSTART+70 ) + V_DrawSciencePatch(KNUXX<= 0 && idlecount < 2 ) + V_DrawSciencePatch(KNUXX<= 2 && idlecount < 6 ) + V_DrawSciencePatch(KNUXX<= 6 && idlecount < 7 ) + V_DrawSciencePatch(KNUXX<= 7 && idlecount < 10) + V_DrawSciencePatch(KNUXX<= 10 && idlecount < 12) + V_DrawSciencePatch(KNUXX<= 12 && idlecount < 16) + V_DrawSciencePatch(KNUXX<= 16 && idlecount < 17) + V_DrawSciencePatch(KNUXX<= TAILSSTART) + { + if (finalecount < TAILSIDLE) + { + // + // Tails Back Layer Intro + // + if (finalecount >= TAILSSTART+0 && finalecount < TAILSSTART+6 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+6 && finalecount < TAILSSTART+10 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+10 && finalecount < TAILSSTART+12 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+12 && finalecount < TAILSSTART+16 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+16 && finalecount < TAILSSTART+22 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+22 && finalecount < TAILSSTART+23 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+23 && finalecount < TAILSSTART+26 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+26 && finalecount < TAILSSTART+30 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+30 && finalecount < TAILSSTART+35 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+35 && finalecount < TAILSSTART+41 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+41 && finalecount < TAILSSTART+43 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+43 && finalecount < TAILSSTART+47 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+47 && finalecount < TAILSSTART+51 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+51 && finalecount < TAILSSTART+53 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+53 && finalecount < TAILSSTART+56 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+56 && finalecount < TAILSSTART+60 ) + V_DrawSciencePatch(TAILSX<= +0 && idlecount < +2 ) + V_DrawSciencePatch(TAILSX<= +2 && idlecount < +6 ) + V_DrawSciencePatch(TAILSX<= +6 && idlecount < +7 ) + V_DrawSciencePatch(TAILSX<= +7 && idlecount < +10) + V_DrawSciencePatch(TAILSX<= +10 && idlecount < +12) + V_DrawSciencePatch(TAILSX<= +12 && idlecount < +16) + V_DrawSciencePatch(TAILSX<= +16 && idlecount < +17) + V_DrawSciencePatch(TAILSX<= SONICSTART) + { + if (finalecount < SONICIDLE) + { + // + // Sonic Back Layer Intro + // + if (finalecount >= SONICSTART+0 && finalecount < SONICSTART+6 ) + V_DrawSciencePatch(SONICX<= SONICSTART+6 && finalecount < SONICSTART+11 ) + V_DrawSciencePatch(SONICX<= SONICSTART+11 && finalecount < SONICSTART+14 ) + V_DrawSciencePatch(SONICX<= SONICSTART+14 && finalecount < SONICSTART+18 ) + V_DrawSciencePatch(SONICX<= SONICSTART+18 && finalecount < SONICSTART+19 ) + V_DrawSciencePatch(SONICX<= SONICSTART+19 && finalecount < SONICSTART+27 ) + V_DrawSciencePatch(SONICX<= SONICSTART+27 && finalecount < SONICSTART+31 ) + V_DrawSciencePatch(SONICX<= SONICSTART+31 && finalecount < SONICSTART+33 ) + // Frame is blank + // V_DrawSciencePatch(SONICX<= SONICSTART+33 && finalecount < SONICSTART+36 ) + V_DrawSciencePatch(SONICX<= SONICSTART+36 && finalecount < SONICSTART+40 ) + V_DrawSciencePatch(SONICX<= SONICSTART+40 && finalecount < SONICSTART+44 ) + V_DrawSciencePatch(SONICX<= SONICSTART+44 && finalecount < SONICSTART+47 ) + V_DrawSciencePatch(SONICX<= SONICSTART+47 && finalecount < SONICSTART+49 ) + V_DrawSciencePatch(SONICX<= SONICSTART+49 && finalecount < SONICSTART+50 ) + V_DrawSciencePatch(SONICX<= SONICSTART+50 && finalecount < SONICSTART+53 ) + V_DrawSciencePatch(SONICX<= SONICSTART+53 && finalecount < SONICSTART+57 ) + V_DrawSciencePatch(SONICX<= 0 && idlecount < 2 ) + V_DrawSciencePatch(SONICX<= 2 && idlecount < 6 ) + V_DrawSciencePatch(SONICX<= 6 && idlecount < 7 ) + V_DrawSciencePatch(SONICX<= 7 && idlecount < 10) + V_DrawSciencePatch(SONICX<= 10 && idlecount < 12) + V_DrawSciencePatch(SONICX<= 12 && idlecount < 16) + V_DrawSciencePatch(SONICX<= 16 && idlecount < 17) + V_DrawSciencePatch(SONICX< 34) - V_DrawSciencePatch(40<= KNUXSTART) + { + if (finalecount < KNUXIDLE) + { + // + // Knux Front Layer Intro + // + if (finalecount >= KNUXSTART+22 && finalecount < KNUXSTART+28 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+28 && finalecount < KNUXSTART+32 ) + V_DrawSciencePatch(KNUXX<= KNUXSTART+32 && finalecount < KNUXSTART+35 ) + V_DrawSciencePatch(KNUXX<= 0 && idlecount < 5 ) + V_DrawSciencePatch(KNUXX<= 5 && idlecount < 10) + V_DrawSciencePatch(KNUXX<= 10 && idlecount < 13) + V_DrawSciencePatch(KNUXX<= 13 && idlecount < 14) + V_DrawSciencePatch(KNUXX<= 14 && idlecount < 17) + V_DrawSciencePatch(KNUXX<= 17 && idlecount < 21) + V_DrawSciencePatch(KNUXX<= 21 && idlecount < 27) + V_DrawSciencePatch(KNUXX<= 27 && idlecount < 32) + V_DrawSciencePatch(KNUXX<= 32 && idlecount < 34) + V_DrawSciencePatch(KNUXX<= 34 && idlecount < 37) + V_DrawSciencePatch(KNUXX<= 37 && idlecount < 39) + V_DrawSciencePatch(KNUXX<= 39 && idlecount < 42) + V_DrawSciencePatch(KNUXX<= 42 && idlecount < 46) + V_DrawSciencePatch(KNUXX<= TAILSSTART) + { + if (finalecount < TAILSIDLE) + { + // + // Tails Front Layer Intro + // + if (finalecount >= TAILSSTART+26 && finalecount < TAILSSTART+30 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+30 && finalecount < TAILSSTART+35 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+35 && finalecount < TAILSSTART+41 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+41 && finalecount < TAILSSTART+43 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+43 && finalecount < TAILSSTART+47 ) + V_DrawSciencePatch(TAILSX<= TAILSSTART+47 && finalecount < TAILSSTART+51 ) + V_DrawSciencePatch(TAILSX<= SONICSTART) + { + if (finalecount < SONICIDLE) + { + // + // Sonic Front Layer Intro + // + if (finalecount >= SONICSTART+19 && finalecount < SONICSTART+27 ) + V_DrawSciencePatch(SONICX<= SONICSTART+27 && finalecount < SONICSTART+31 ) + V_DrawSciencePatch(SONICX<= SONICSTART+31 && finalecount < SONICSTART+33 ) + V_DrawSciencePatch(SONICX<= SONICSTART+33 && finalecount < SONICSTART+36 ) + V_DrawSciencePatch(SONICX<= SONICSTART+36 && finalecount < SONICSTART+40 ) + V_DrawSciencePatch(SONICX<= SONICSTART+40 && finalecount < SONICSTART+44 ) + V_DrawSciencePatch(SONICX<= SONICSTART+44 && finalecount < SONICSTART+47 ) + V_DrawSciencePatch(SONICX<= SONICSTART+53 && finalecount < SONICSTART+57 ) + V_DrawSciencePatch(SONICX<= 0 && idlecount < 5 ) + V_DrawSciencePatch(SONICX<= 5 && idlecount < 8 ) + V_DrawSciencePatch(SONICX<= 8 && idlecount < 9 ) + V_DrawSciencePatch(SONICX<= 9 && idlecount < 12) + V_DrawSciencePatch(SONICX<= 12 && idlecount < 17) + V_DrawSciencePatch(SONICX<= 17 && idlecount < 19) + V_DrawSciencePatch(SONICX<= 19 && idlecount < 21) + V_DrawSciencePatch(SONICX<= 21 && idlecount < 22) + V_DrawSciencePatch(SONICX<= 22 && idlecount < 25) + V_DrawSciencePatch(SONICX< 29 && finalecount < 35) @@ -2744,6 +3278,20 @@ void F_TitleScreenDrawer(void) else if (finalecount > 34 && 44-finalecount > 0 && 44-finalecount < 10) V_DrawFadeScreen(0, 44-finalecount); +#undef CHARSTART +#undef SONICSTART +#undef SONICIDLE +#undef SONICX +#undef SONICY +#undef TAILSSTART +#undef TAILSIDLE +#undef TAILSX +#undef TAILSY +#undef KNUXSTART +#undef KNUXIDLE +#undef KNUXX +#undef KNUXY + break; case TTMODE_USER: diff --git a/src/f_finale.h b/src/f_finale.h index a14ee6184..0a599fa2d 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -85,7 +85,7 @@ typedef enum TTMODE_USER } ttmode_enum; -#define TTMAX_ALACROIX 29 // max frames for SONIC typeface +#define TTMAX_ALACROIX 30 // max frames for SONIC typeface, plus one for NULL terminating entry #define TTMAX_USER 100 extern ttmode_enum ttmode;