Extra effects for Prison Egg CD

- The goal here is to make it more obvious if a CD drops,
  and make the CD more visible.
- Rainbow sparkles scaled up by x3.
- Play long "powering down" noise when a Prison with a CD
  inside is destroyed.
  - CD spawns after noise stops playing.
- Spawn a twinkle (Gainax).
  - Flickers while "powering down" noise is playing.
  - Enlarges and disappears in sync with the "CD dropped"
    sound effect.
- Darken the map while all of this is happening.
This commit is contained in:
James R 2024-03-05 03:14:07 -08:00
parent f60309983a
commit 18654a8a70
6 changed files with 47 additions and 1 deletions

View file

@ -506,6 +506,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
// Prison Egg Drops
"S_PRISONEGGDROP_CD",
"S_PRISONEGGDROP_FLAREA1",
"S_PRISONEGGDROP_FLAREA2",
"S_PRISONEGGDROP_FLAREB1",
"S_PRISONEGGDROP_FLAREB2",
// Bubble Source
"S_BUBBLES1",

View file

@ -1013,6 +1013,10 @@ state_t states[NUMSTATES] =
// Prison Egg Drops
{SPR_ALTM, 0|FF_PAPERSPRITE|FF_SEMIBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PRISONEGGDROP_CD
{SPR_LENS, 14|FF_FULLBRIGHT|FF_ADD|FF_TRANS10, 1, {NULL}, 0, 0, S_PRISONEGGDROP_FLAREA2}, // S_PRISONEGGDROP_FLAREA1
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_PRISONEGGDROP_FLAREA1}, // S_PRISONEGGDROP_FLAREA2
{SPR_LENS, 11|FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE, 16, {NULL}, 7, 2, S_PRISONEGGDROP_FLAREB2}, // S_PRISONEGGDROP_FLAREB1
{SPR_LENS, 19|FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE, 6, {NULL}, 1, 2, S_NULL}, // S_PRISONEGGDROP_FLAREB2
// Bubble Source
{SPR_BBLS, 0, 8, {A_BubbleSpawn}, 2048, 0, S_BUBBLES2}, // S_BUBBLES1

View file

@ -1499,6 +1499,10 @@ typedef enum state
// Prison Egg Drops
S_PRISONEGGDROP_CD,
S_PRISONEGGDROP_FLAREA1,
S_PRISONEGGDROP_FLAREA2,
S_PRISONEGGDROP_FLAREB1,
S_PRISONEGGDROP_FLAREB2,
// Bubble Source
S_BUBBLES1,

View file

@ -1226,6 +1226,10 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
if (secretpickup)
{
// Grab attention with a long sound effect.
target->hitlag += 56;
S_StartSound(target, sfx_s3k85);
secretpickup->hitlag = target->hitlag;
secretpickup->z -= secretpickup->height/2;
@ -1252,6 +1256,26 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
secretpickup, secretpickup->angle,
P_ReturnThrustX(secretpickup, launchangle, launchmomentum)
);
mobj_t *flare = P_SpawnMobj(
target->x, target->y,
target->z + target->height/2,
MT_SPARK
);
if (flare)
{
// Will flicker in place until secretpickup exits hitlag.
flare->colorized = true;
flare->renderflags |= RF_ALWAYSONTOP;
P_InstaScale(flare, 4 * flare->scale);
P_SetTarget(&secretpickup->target, flare);
P_SetMobjStateNF(flare, S_PRISONEGGDROP_FLAREA1);
}
// Darken the level for roughly how long it takes until the last sound effect stops playing.
g_darkness.start = leveltime;
g_darkness.end = leveltime + target->hitlag + TICRATE + DARKNESS_FADE_TIME;
}
}
}

View file

@ -7499,6 +7499,10 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
mobj->z += P_MobjFlip(mobj);
mobj->flags2 |= MF2_AMBUSH;
// Finish flare animation.
if (mobj->target && !P_MobjWasRemoved(mobj->target))
P_SetMobjStateNF(mobj->target, S_PRISONEGGDROP_FLAREB1);
}
if (teststate == S_PRISONEGGDROP_CD)
@ -7538,6 +7542,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
sparkle->color = M_RandomChance(FRACUNIT/2) ? SKINCOLOR_ULTRAMARINE : SKINCOLOR_MAGENTA;
sparkle->momz += 8 * mobj->scale * P_MobjFlip(mobj);
sparkle->scale = 3 * sparkle->scale;
sparkle->scalespeed = abs(sparkle->scale - sparkle->destscale) / 16;
// Colorize flare.
if (mobj->target && !P_MobjWasRemoved(mobj->target))
mobj->target->color = sparkle->color;
}
}
}

View file

@ -534,7 +534,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Burst"},
{"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"},
{"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"},
{"s3k85", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering down"},
{"s3k85", false, 64, 24, -1, NULL, 0, -1, -1, LUMPERROR, "Powering down"},
{"s3k86", false, 128, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Alarm"},
{"s3k87", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"},
{"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic squeak"},