Merge branch 'ballhog-descam' into 'master'

Ballhog fixups (+ sound cleanup)

See merge request KartKrew/Kart!1590
This commit is contained in:
Oni 2023-11-03 03:13:13 +00:00
commit 6e6c0cd71f
4 changed files with 54 additions and 10 deletions

View file

@ -1390,8 +1390,11 @@ static void K_drawKartItem(void)
}
else if (stplyr->ballhogcharge > 0)
{
itembar = stplyr->ballhogcharge;
maxl = (((stplyr->itemamount-1) * BALLHOGINCREMENT) + 1);
// itembar = stplyr->ballhogcharge;
// maxl = (((stplyr->itemamount-1) * BALLHOGINCREMENT) + 1);
itembar = stplyr->ballhogcharge % BALLHOGINCREMENT;
maxl = BALLHOGINCREMENT;
if (leveltime & 1)
localpatch[1] = kp_ballhog[offset];
@ -1549,7 +1552,10 @@ static void K_drawKartItem(void)
// Draw the item above the box.
V_ClearClipRect();
if (stplyr->itemamount >= numberdisplaymin && stplyr->itemRoulette.active == false)
// A little goofy, but helps with ballhog charge conveyance—you're "loading" them.
UINT8 fakeitemamount = stplyr->itemamount - (stplyr->ballhogcharge / BALLHOGINCREMENT);
if (fakeitemamount >= numberdisplaymin && stplyr->itemRoulette.active == false)
{
// Then, the numbers:
V_DrawScaledPatch(
@ -1567,14 +1573,14 @@ static void K_drawKartItem(void)
if (offset)
{
if (flipamount) // reminder that this is for 3/4p's right end of the screen.
V_DrawString(fx+2, fy+31, V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", stplyr->itemamount));
V_DrawString(fx+2, fy+31, V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", fakeitemamount));
else
V_DrawString(fx+24, fy+31, V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", stplyr->itemamount));
V_DrawString(fx+24, fy+31, V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", fakeitemamount));
}
else
{
V_DrawScaledPatch(fy+28, fy+41, V_HUDTRANS|V_SLIDEIN|fflags, kp_itemx);
V_DrawTimerString(fx+38, fy+36, V_HUDTRANS|V_SLIDEIN|fflags, va("%d", stplyr->itemamount));
V_DrawTimerString(fx+38, fy+36, V_HUDTRANS|V_SLIDEIN|fflags, va("%d", fakeitemamount));
}
}
else

View file

@ -8467,6 +8467,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
eggsexplode->height = 2 * player->mo->height;
K_FlipFromObject(eggsexplode, player->mo);
S_StopSoundByID(player->mo, sfx_s3k53);
eggsexplode->threshold = KITEM_EGGMAN;
P_SetTarget(&eggsexplode->tracer, player->mo);
@ -11489,12 +11491,26 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
case KITEM_BALLHOG:
if (!HOLDING_ITEM && NO_HYUDORO)
{
INT32 ballhogmax = ((player->itemamount-1) * BALLHOGINCREMENT) + 1;
INT32 ballhogmax = (player->itemamount) * BALLHOGINCREMENT;
if ((cmd->buttons & BT_ATTACK) && (player->pflags & PF_HOLDREADY)
&& (player->ballhogcharge < ballhogmax))
{
player->ballhogcharge++;
if (player->ballhogcharge % BALLHOGINCREMENT == 0)
{
sfxenum_t hogsound[] =
{
sfx_bhog00,
sfx_bhog01,
sfx_bhog02,
sfx_bhog03,
sfx_bhog04,
sfx_bhog05
};
UINT8 chargesound = max(1, min(player->ballhogcharge / BALLHOGINCREMENT, 6));
S_StartSound(player->mo, hogsound[chargesound-1]);
}
}
else
{
@ -11509,12 +11525,17 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player->ballhogcharge > 0)
{
INT32 numhogs = min((player->ballhogcharge / BALLHOGINCREMENT) + 1, player->itemamount);
INT32 numhogs = min((player->ballhogcharge / BALLHOGINCREMENT), player->itemamount);
if (numhogs <= 1)
if (numhogs <= 0)
{
// no tapfire scams
}
else if (numhogs == 1)
{
player->itemamount--;
K_ThrowKartItem(player, true, MT_BALLHOG, 1, 0, 0);
K_PlayAttackTaunt(player->mo);
}
else
{
@ -11530,10 +11551,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_ThrowKartItem(player, true, MT_BALLHOG, 1, 0, angleOffset);
angleOffset -= offsetAmt;
}
K_PlayAttackTaunt(player->mo);
}
player->ballhogcharge = 0;
K_PlayAttackTaunt(player->mo);
player->pflags &= ~PF_HOLDREADY;
}
}

View file

@ -1113,6 +1113,14 @@ 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 - Ballhog Charge
{"bhog00", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
{"bhog01", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
{"bhog02", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
{"bhog03", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
{"bhog04", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
{"bhog05", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Ballhog charging"},
// 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"},

View file

@ -1181,6 +1181,14 @@ typedef enum
sfx_slot04,
sfx_slot05,
// RR - Ballhog Charge
sfx_bhog00,
sfx_bhog01,
sfx_bhog02,
sfx_bhog03,
sfx_bhog04,
sfx_bhog05,
// RR - Gachabom rebound
sfx_grbnd1,
sfx_grbnd2,