From 31fbb29b880cfcccf45f94af352c3b74380e2e72 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sun, 22 Oct 2023 00:06:07 -0700 Subject: [PATCH] Gachabom fixups --- src/objects/gachabom-rebound.cpp | 12 +++++++++++- src/sounds.c | 5 +++++ src/sounds.h | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/objects/gachabom-rebound.cpp b/src/objects/gachabom-rebound.cpp index 7da4a3f81..d64435867 100644 --- a/src/objects/gachabom-rebound.cpp +++ b/src/objects/gachabom-rebound.cpp @@ -7,6 +7,7 @@ #include "../p_local.h" #include "../r_main.h" #include "../tables.h" +#include "../s_sound.h" /* An object may not be visible on the same tic: 1) that it spawned @@ -16,6 +17,7 @@ #define rebound_target(o) ((o)->target) #define rebound_mode(o) ((o)->threshold) #define rebound_timer(o) ((o)->reactiontime) +#define played_rebound_sound(o) ((o)->movefactor) namespace { @@ -65,7 +67,7 @@ bool award_target(mobj_t* mobj) return true; } - if ((player->itemtype == KITEM_GACHABOM || player->itemtype == KITEM_NONE) && !player->itemRoulette.active) + if ((player->itemtype == KITEM_GACHABOM || player->itemtype == KITEM_NONE) && !player->itemRoulette.active && !player->instaWhipCharge) { rebound_timer(mobj)--; @@ -75,6 +77,9 @@ bool award_target(mobj_t* mobj) player->itemamount++; if (player->roundconditions.gachabom_miser == 1) player->roundconditions.gachabom_miser = 0; + + //S_StartSoundAtVolume(target, sfx_grbnd3, 255/3); + S_StartSound(target, sfx_itpick); return true; } @@ -93,6 +98,7 @@ void chase_rebound_target(mobj_t* mobj) if (distance <= travelDistance) { rebound_mode(mobj) = static_cast(Mode::kOrbit); + S_StartSoundAtVolume(mobj, sfx_grbnd2, 255/2); // Freeze mobj->momx = 0; @@ -116,6 +122,10 @@ void chase_rebound_target(mobj_t* mobj) { mobj->scalespeed = newSpeed; } + + if (!played_rebound_sound(mobj)) + S_StartSoundAtVolume(mobj, sfx_grbnd1, 255/2); + played_rebound_sound(mobj) = true; } } diff --git a/src/sounds.c b/src/sounds.c index 54003ce27..426ccc28a 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1113,6 +1113,11 @@ sfxinfo_t S_sfx[NUMSFX] = {"slot04", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Seven"}, {"slot05", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "JACKPOT!"}, + // RR - Gachabom rebound + {"grbnd1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Gachabom returning"}, + {"grbnd2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Gachabom orbiting"}, + {"grbnd3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Gachabom re-collected"}, + // 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 diff --git a/src/sounds.h b/src/sounds.h index 76960c87b..938b9c7da 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1181,6 +1181,11 @@ typedef enum sfx_slot04, sfx_slot05, + // RR - Gachabom rebound + sfx_grbnd1, + sfx_grbnd2, + sfx_grbnd3, + // SRB2Kart - Drop target sounds sfx_kdtrg1, sfx_kdtrg2,