Merge branch 'droptargetsound' into 'master'

Dynamic sounds for drop target collision

See merge request KartKrew/Kart!575
This commit is contained in:
toaster 2022-04-27 19:45:17 +00:00
commit f13149c061
4 changed files with 20 additions and 1 deletions

View file

@ -560,6 +560,14 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2)
t2->threshold = 10; t2->threshold = 10;
} }
if (t1->reactiontime > 1000) {
S_StartSound(t2, sfx_kdtrg3);
} else if (t1->reactiontime > 500) {
S_StartSound(t2, sfx_kdtrg2);
} else {
S_StartSound(t2, sfx_kdtrg1);
}
if (draggeddroptarget && draggeddroptarget->player) if (draggeddroptarget && draggeddroptarget->player)
{ {
// The following removes t1, be warned // The following removes t1, be warned

View file

@ -1275,7 +1275,8 @@ static void K_SpawnBumpForObjs(mobj_t *mobj1, mobj_t *mobj2)
} }
else if (mobj1->type == MT_DROPTARGET || mobj1->type == MT_DROPTARGET_SHIELD) // no need to check the other way around else if (mobj1->type == MT_DROPTARGET || mobj1->type == MT_DROPTARGET_SHIELD) // no need to check the other way around
{ {
S_StartSound(mobj2, sfx_s258); // Sound handled in K_DropTargetCollide
// S_StartSound(mobj2, sfx_s258);
fx->colorized = true; fx->colorized = true;
fx->color = mobj1->color; fx->color = mobj1->color;
} }

View file

@ -1103,6 +1103,11 @@ sfxinfo_t S_sfx[NUMSFX] =
{"typri1", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 boss typewriting 1 {"typri1", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 boss typewriting 1
{"typri2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 final boss-type typewriting {"typri2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 final boss-type typewriting
// SRB2Kart - Drop target sounds
{"kdtrg1", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Low energy, SF_X8AWAYSOUND
{"kdtrg2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Medium energy, SF_X8AWAYSOUND
{"kdtrg3", false, 64, 80, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // High energy, SF_X2AWAYSOUND|SF_X8AWAYSOUND
// SRB2Kart - Engine sounds // SRB2Kart - Engine sounds
// Engine class A // Engine class A
{"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""},

View file

@ -1167,6 +1167,11 @@ typedef enum
sfx_typri1, sfx_typri1,
sfx_typri2, sfx_typri2,
// SRB2Kart - Drop target sounds
sfx_kdtrg1,
sfx_kdtrg2,
sfx_kdtrg3,
// Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy... // Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy...
// Engine class A - Low Speed, Low Weight // Engine class A - Low Speed, Low Weight
sfx_krta00, sfx_krta00,