Merge branch 'master' into 'toast_pokes'
# Conflicts: # src/hu_stuff.c
This commit is contained in:
commit
1e4207c1de
|
@ -2295,9 +2295,9 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
if (players[tab[i].num].spectator || !players[tab[i].num].mo)
|
if (players[tab[i].num].spectator || !players[tab[i].num].mo)
|
||||||
continue; //ignore them.
|
continue; //ignore them.
|
||||||
|
|
||||||
if (!splitscreen) // don't draw it on splitscreen,
|
if (netgame) // don't draw it offline
|
||||||
{
|
{
|
||||||
if (!(tab[i].num == serverplayer))
|
if (tab[i].num != serverplayer)
|
||||||
HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false);
|
HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
109
src/k_kart.c
109
src/k_kart.c
|
@ -666,7 +666,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
|
||||||
break;
|
break;
|
||||||
case KITEM_INVINCIBILITY:
|
case KITEM_INVINCIBILITY:
|
||||||
POWERITEMODDS(newodds);
|
POWERITEMODDS(newodds);
|
||||||
if ((!cv_invincibility.value) || (pinvin > 2)) newodds = 0;
|
if ((!cv_invincibility.value) || (pinvin >= 2)) newodds = 0;
|
||||||
break;
|
break;
|
||||||
case KITEM_BANANA:
|
case KITEM_BANANA:
|
||||||
if (!cv_banana.value) newodds = 0;
|
if (!cv_banana.value) newodds = 0;
|
||||||
|
@ -700,7 +700,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
|
||||||
break;
|
break;
|
||||||
case KITEM_GROW:
|
case KITEM_GROW:
|
||||||
POWERITEMODDS(newodds);
|
POWERITEMODDS(newodds);
|
||||||
if ((!cv_grow.value) || (pinvin > 2)) newodds = 0;
|
if ((!cv_grow.value) || (pinvin >= 2)) newodds = 0;
|
||||||
break;
|
break;
|
||||||
case KITEM_SHRINK:
|
case KITEM_SHRINK:
|
||||||
POWERITEMODDS(newodds);
|
POWERITEMODDS(newodds);
|
||||||
|
@ -1362,8 +1362,8 @@ void K_RespawnChecker(player_t *player)
|
||||||
fixed_t newx, newy, newz;
|
fixed_t newx, newy, newz;
|
||||||
|
|
||||||
newangle = FixedAngle(((360/8)*i)*FRACUNIT);
|
newangle = FixedAngle(((360/8)*i)*FRACUNIT);
|
||||||
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31*player->mo->scale);
|
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31<<FRACBITS); // does NOT use scale, since this effect doesn't scale properly
|
||||||
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 31*player->mo->scale);
|
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 31<<FRACBITS);
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
newz = player->mo->z + player->mo->height;
|
newz = player->mo->z + player->mo->height;
|
||||||
else
|
else
|
||||||
|
@ -1383,11 +1383,19 @@ void K_RespawnChecker(player_t *player)
|
||||||
}
|
}
|
||||||
else if (player->kartstuff[k_respawn] == 1)
|
else if (player->kartstuff[k_respawn] == 1)
|
||||||
{
|
{
|
||||||
if (!P_IsObjectOnGround(player->mo))
|
if (player->kartstuff[k_growshrinktimer] < 0)
|
||||||
|
{
|
||||||
|
player->mo->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/TICRATE;
|
||||||
|
player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8;
|
||||||
|
if (cv_kartdebugshrink.value && !player->bot)
|
||||||
|
player->mo->destscale = 6*player->mo->destscale/8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!P_IsObjectOnGround(player->mo) && !mapreset)
|
||||||
{
|
{
|
||||||
player->powers[pw_flashing] = 2;
|
player->powers[pw_flashing] = 2;
|
||||||
|
|
||||||
// Sal: That's stupid and prone to accidental usage.
|
// Sal: The old behavior was stupid and prone to accidental usage.
|
||||||
// Let's rip off Mania instead, and turn this into a Drop Dash!
|
// Let's rip off Mania instead, and turn this into a Drop Dash!
|
||||||
|
|
||||||
if (cmd->buttons & BT_ACCELERATE)
|
if (cmd->buttons & BT_ACCELERATE)
|
||||||
|
@ -1847,19 +1855,15 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
|
||||||
|
|
||||||
player->kartstuff[k_spinouttype] = type;
|
player->kartstuff[k_spinouttype] = type;
|
||||||
|
|
||||||
if (player->kartstuff[k_spinouttype] <= 0)
|
if (player->kartstuff[k_spinouttype] <= 0) // type 0 is spinout, type 1 is wipeout
|
||||||
{
|
{
|
||||||
player->kartstuff[k_spinouttimer] = 3*TICRATE/2; // Banana Spinout
|
|
||||||
|
|
||||||
// At spinout, player speed is increased to 1/4 their regular speed, moving them forward
|
// At spinout, player speed is increased to 1/4 their regular speed, moving them forward
|
||||||
if (player->speed < K_GetKartSpeed(player, true)/4)
|
if (player->speed < K_GetKartSpeed(player, true)/4)
|
||||||
P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale));
|
P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale));
|
||||||
|
|
||||||
S_StartSound(player->mo, sfx_slip);
|
S_StartSound(player->mo, sfx_slip);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
player->kartstuff[k_spinouttimer] = TICRATE+20; // Wipeout
|
|
||||||
|
|
||||||
|
player->kartstuff[k_spinouttimer] = (3*TICRATE/2)+2;
|
||||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||||
|
|
||||||
if (player->mo->state != &states[S_KART_SPIN])
|
if (player->mo->state != &states[S_KART_SPIN])
|
||||||
|
@ -2032,7 +2036,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
|
||||||
|
|
||||||
if (inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1)
|
if (inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1)
|
||||||
{
|
{
|
||||||
player->kartstuff[k_spinouttimer] = (3*player->kartstuff[k_spinouttimer])/2;
|
player->kartstuff[k_spinouttimer] = ((3*player->kartstuff[k_spinouttimer])/2)+1;
|
||||||
player->mo->momz *= 2;
|
player->mo->momz *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3879,7 +3883,12 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
fast->momz = 3*player->mo->momz/4;
|
fast->momz = 3*player->mo->momz/4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->kartstuff[k_eggmanexplode]) // You're gonna diiiiie
|
if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here
|
||||||
|
{
|
||||||
|
player->mo->colorized = false;
|
||||||
|
player->mo->color = player->skincolor;
|
||||||
|
}
|
||||||
|
else if (player->kartstuff[k_eggmanexplode]) // You're gonna diiiiie
|
||||||
{
|
{
|
||||||
const INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE);
|
const INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE);
|
||||||
if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0))
|
if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0))
|
||||||
|
@ -3956,6 +3965,18 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
player->kartstuff[k_timeovercam] = 0;
|
player->kartstuff[k_timeovercam] = 0;
|
||||||
|
|
||||||
|
// Make ABSOLUTELY SURE that your flashing tics don't get set WHILE you're still in hit animations.
|
||||||
|
if (player->kartstuff[k_spinouttimer] != 0
|
||||||
|
|| player->kartstuff[k_wipeoutslow] != 0
|
||||||
|
|| player->kartstuff[k_squishedtimer] != 0)
|
||||||
|
{
|
||||||
|
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||||
|
}
|
||||||
|
else if (player->powers[pw_flashing] == K_GetKartFlashing(player))
|
||||||
|
{
|
||||||
|
player->powers[pw_flashing]--;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->kartstuff[k_spinouttimer])
|
if (player->kartstuff[k_spinouttimer])
|
||||||
{
|
{
|
||||||
if ((P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1)
|
if ((P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1)
|
||||||
|
@ -3983,9 +4004,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing(player))
|
|
||||||
player->powers[pw_flashing]--;
|
|
||||||
|
|
||||||
/*if (player->kartstuff[k_thunderanim])
|
/*if (player->kartstuff[k_thunderanim])
|
||||||
player->kartstuff[k_thunderanim]--;*/
|
player->kartstuff[k_thunderanim]--;*/
|
||||||
|
|
||||||
|
@ -4008,11 +4026,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
if (player->kartstuff[k_invincibilitytimer])
|
if (player->kartstuff[k_invincibilitytimer])
|
||||||
player->kartstuff[k_invincibilitytimer]--;
|
player->kartstuff[k_invincibilitytimer]--;
|
||||||
|
|
||||||
|
if (!player->kartstuff[k_respawn])
|
||||||
|
{
|
||||||
if (player->kartstuff[k_growshrinktimer] > 0)
|
if (player->kartstuff[k_growshrinktimer] > 0)
|
||||||
player->kartstuff[k_growshrinktimer]--;
|
player->kartstuff[k_growshrinktimer]--;
|
||||||
|
|
||||||
if (player->kartstuff[k_growshrinktimer] < 0)
|
if (player->kartstuff[k_growshrinktimer] < 0)
|
||||||
player->kartstuff[k_growshrinktimer]++;
|
player->kartstuff[k_growshrinktimer]++;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->kartstuff[k_growshrinktimer] == 1 || player->kartstuff[k_growshrinktimer] == -1)
|
if (player->kartstuff[k_growshrinktimer] == 1 || player->kartstuff[k_growshrinktimer] == -1)
|
||||||
{
|
{
|
||||||
|
@ -5501,8 +5521,8 @@ static patch_t *kp_karmasticker;
|
||||||
static patch_t *kp_splitkarmabomb;
|
static patch_t *kp_splitkarmabomb;
|
||||||
static patch_t *kp_timeoutsticker;
|
static patch_t *kp_timeoutsticker;
|
||||||
|
|
||||||
static patch_t *kp_startcountdown[8];
|
static patch_t *kp_startcountdown[16];
|
||||||
static patch_t *kp_racefinish[2];
|
static patch_t *kp_racefinish[6];
|
||||||
|
|
||||||
static patch_t *kp_positionnum[NUMPOSNUMS][NUMPOSFRAMES];
|
static patch_t *kp_positionnum[NUMPOSNUMS][NUMPOSFRAMES];
|
||||||
static patch_t *kp_winnernum[NUMPOSFRAMES];
|
static patch_t *kp_winnernum[NUMPOSFRAMES];
|
||||||
|
@ -5589,9 +5609,25 @@ void K_LoadKartHUDGraphics(void)
|
||||||
kp_startcountdown[5] = W_CachePatchName("K_CNT2B", PU_HUDGFX);
|
kp_startcountdown[5] = W_CachePatchName("K_CNT2B", PU_HUDGFX);
|
||||||
kp_startcountdown[6] = W_CachePatchName("K_CNT1B", PU_HUDGFX);
|
kp_startcountdown[6] = W_CachePatchName("K_CNT1B", PU_HUDGFX);
|
||||||
kp_startcountdown[7] = W_CachePatchName("K_CNTGOB", PU_HUDGFX);
|
kp_startcountdown[7] = W_CachePatchName("K_CNTGOB", PU_HUDGFX);
|
||||||
|
// Splitscreen
|
||||||
|
kp_startcountdown[8] = W_CachePatchName("K_SMC3A", PU_HUDGFX);
|
||||||
|
kp_startcountdown[9] = W_CachePatchName("K_SMC2A", PU_HUDGFX);
|
||||||
|
kp_startcountdown[10] = W_CachePatchName("K_SMC1A", PU_HUDGFX);
|
||||||
|
kp_startcountdown[11] = W_CachePatchName("K_SMCGOA", PU_HUDGFX);
|
||||||
|
kp_startcountdown[12] = W_CachePatchName("K_SMC3B", PU_HUDGFX);
|
||||||
|
kp_startcountdown[13] = W_CachePatchName("K_SMC2B", PU_HUDGFX);
|
||||||
|
kp_startcountdown[14] = W_CachePatchName("K_SMC1B", PU_HUDGFX);
|
||||||
|
kp_startcountdown[15] = W_CachePatchName("K_SMCGOB", PU_HUDGFX);
|
||||||
|
|
||||||
|
// Finish
|
||||||
kp_racefinish[0] = W_CachePatchName("K_FINA", PU_HUDGFX);
|
kp_racefinish[0] = W_CachePatchName("K_FINA", PU_HUDGFX);
|
||||||
kp_racefinish[1] = W_CachePatchName("K_FINB", PU_HUDGFX);
|
kp_racefinish[1] = W_CachePatchName("K_FINB", PU_HUDGFX);
|
||||||
|
// Splitscreen
|
||||||
|
kp_racefinish[2] = W_CachePatchName("K_SMFINA", PU_HUDGFX);
|
||||||
|
kp_racefinish[3] = W_CachePatchName("K_SMFINB", PU_HUDGFX);
|
||||||
|
// 2P splitscreen
|
||||||
|
kp_racefinish[4] = W_CachePatchName("K_2PFINA", PU_HUDGFX);
|
||||||
|
kp_racefinish[5] = W_CachePatchName("K_2PFINB", PU_HUDGFX);
|
||||||
|
|
||||||
// Position numbers
|
// Position numbers
|
||||||
sprintf(buffer, "K_POSNxx");
|
sprintf(buffer, "K_POSNxx");
|
||||||
|
@ -6585,7 +6621,7 @@ static void K_drawKartWanted(void)
|
||||||
if (splitscreen) // Can't fit the poster on screen, sadly
|
if (splitscreen) // Can't fit the poster on screen, sadly
|
||||||
{
|
{
|
||||||
if (K_IsPlayerWanted(stplyr) && leveltime % 10 > 3)
|
if (K_IsPlayerWanted(stplyr) && leveltime % 10 > 3)
|
||||||
V_DrawRightAlignedString(WANT_X, WANT_Y, K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS|V_REDMAP), "WANTED");
|
V_DrawRightAlignedString(WANT_X, WANT_Y, K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS|V_ORANGEMAP), "WANTED");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6924,10 +6960,9 @@ static void K_drawKartStartCountdown(void)
|
||||||
pnum++;
|
pnum++;
|
||||||
if ((leveltime % (2*5)) / 5) // blink
|
if ((leveltime % (2*5)) / 5) // blink
|
||||||
pnum += 4;
|
pnum += 4;
|
||||||
|
if (splitscreen) // splitscreen
|
||||||
|
pnum += 8;
|
||||||
|
|
||||||
if (splitscreen)
|
|
||||||
V_DrawSmallScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/4), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/4), splitflags, kp_startcountdown[pnum]);
|
|
||||||
else
|
|
||||||
V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), splitflags, kp_startcountdown[pnum]);
|
V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), splitflags, kp_startcountdown[pnum]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6941,12 +6976,14 @@ static void K_drawKartFinish(void)
|
||||||
if ((stplyr->kartstuff[k_cardanimation] % (2*5)) / 5) // blink
|
if ((stplyr->kartstuff[k_cardanimation] % (2*5)) / 5) // blink
|
||||||
pnum = 1;
|
pnum = 1;
|
||||||
|
|
||||||
if (splitscreen > 1)
|
if (splitscreen > 1) // small splitscreen
|
||||||
{
|
pnum += 2;
|
||||||
V_DrawTinyScaledPatch(STCD_X - (SHORT(kp_racefinish[pnum]->width)/8), STCD_Y - (SHORT(kp_racefinish[pnum]->height)/8), splitflags, kp_racefinish[pnum]);
|
else if (splitscreen == 1) // wide splitscreen
|
||||||
return;
|
pnum += 4;
|
||||||
}
|
|
||||||
|
|
||||||
|
if (splitscreen > 1) // Stationary FIN
|
||||||
|
V_DrawScaledPatch(STCD_X - (SHORT(kp_racefinish[pnum]->width)/2), STCD_Y - (SHORT(kp_racefinish[pnum]->height)/2), splitflags, kp_racefinish[pnum]);
|
||||||
|
else // Scrolling FINISH
|
||||||
{
|
{
|
||||||
INT32 scaleshift = (FRACBITS - splitscreen); // FRACUNIT or FRACUNIT/2
|
INT32 scaleshift = (FRACBITS - splitscreen); // FRACUNIT or FRACUNIT/2
|
||||||
INT32 x = ((vid.width<<FRACBITS)/vid.dupx), xval = (SHORT(kp_racefinish[pnum]->width)<<scaleshift);
|
INT32 x = ((vid.width<<FRACBITS)/vid.dupx), xval = (SHORT(kp_racefinish[pnum]->width)<<scaleshift);
|
||||||
|
@ -7013,7 +7050,7 @@ static void K_drawBattleFullscreen(void)
|
||||||
{
|
{
|
||||||
if (stplyr->kartstuff[k_position] == 1)
|
if (stplyr->kartstuff[k_position] == 1)
|
||||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, kp_battlewin, NULL);
|
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, kp_battlewin, NULL);
|
||||||
else if (splitscreen < 2)
|
else
|
||||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, (K_IsPlayerLosing(stplyr) ? kp_battlelose : kp_battlecool), NULL);
|
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, (K_IsPlayerLosing(stplyr) ? kp_battlelose : kp_battlecool), NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -7343,38 +7380,38 @@ static void K_drawLapStartAnim(void)
|
||||||
const UINT8 progress = 80-stplyr->kartstuff[k_lapanimation];
|
const UINT8 progress = 80-stplyr->kartstuff[k_lapanimation];
|
||||||
|
|
||||||
V_DrawScaledPatch(BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)),
|
V_DrawScaledPatch(BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)),
|
||||||
64 - (32*max(0, progress-76)),
|
56 - (32*max(0, progress-76)),
|
||||||
0, kp_lapanim_emblem);
|
0, kp_lapanim_emblem);
|
||||||
|
|
||||||
if (stplyr->laps == (UINT8)(cv_numlaps.value - 1))
|
if (stplyr->laps == (UINT8)(cv_numlaps.value - 1))
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(27 - (32*max(0, progress-76)),
|
V_DrawScaledPatch(27 - (32*max(0, progress-76)),
|
||||||
40,
|
32,
|
||||||
0, kp_lapanim_final[min(progress/2, 10)]);
|
0, kp_lapanim_final[min(progress/2, 10)]);
|
||||||
|
|
||||||
if (progress/2-12 >= 0)
|
if (progress/2-12 >= 0)
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(194 + (32*max(0, progress-76)),
|
V_DrawScaledPatch(194 + (32*max(0, progress-76)),
|
||||||
40,
|
32,
|
||||||
0, kp_lapanim_lap[min(progress/2-12, 6)]);
|
0, kp_lapanim_lap[min(progress/2-12, 6)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(61 - (32*max(0, progress-76)),
|
V_DrawScaledPatch(61 - (32*max(0, progress-76)),
|
||||||
40,
|
32,
|
||||||
0, kp_lapanim_lap[min(progress/2, 6)]);
|
0, kp_lapanim_lap[min(progress/2, 6)]);
|
||||||
|
|
||||||
if (progress/2-8 >= 0)
|
if (progress/2-8 >= 0)
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(194 + (32*max(0, progress-76)),
|
V_DrawScaledPatch(194 + (32*max(0, progress-76)),
|
||||||
40,
|
32,
|
||||||
0, kp_lapanim_number[(((UINT32)stplyr->laps+1) / 10)][min(progress/2-8, 2)]);
|
0, kp_lapanim_number[(((UINT32)stplyr->laps+1) / 10)][min(progress/2-8, 2)]);
|
||||||
|
|
||||||
if (progress/2-10 >= 0)
|
if (progress/2-10 >= 0)
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(221 + (32*max(0, progress-76)),
|
V_DrawScaledPatch(221 + (32*max(0, progress-76)),
|
||||||
40,
|
32,
|
||||||
0, kp_lapanim_number[(((UINT32)stplyr->laps+1) % 10)][min(progress/2-10, 2)]);
|
0, kp_lapanim_number[(((UINT32)stplyr->laps+1) % 10)][min(progress/2-10, 2)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6798,7 +6798,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
&& mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD
|
&& mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD
|
||||||
/*&& players[displayplayer].mo && !players[displayplayer].spectator*/)
|
/*&& players[displayplayer].mo && !players[displayplayer].spectator*/)
|
||||||
{
|
{
|
||||||
fixed_t scale = mobj->target->scale;
|
fixed_t scale = 4*mobj->target->scale;
|
||||||
mobj->color = mobj->target->color;
|
mobj->color = mobj->target->color;
|
||||||
K_MatchGenericExtraFlags(mobj, mobj->target);
|
K_MatchGenericExtraFlags(mobj, mobj->target);
|
||||||
|
|
||||||
|
@ -6993,7 +6993,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
&& mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD
|
&& mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD
|
||||||
&& players[displayplayer].mo && !players[displayplayer].spectator)
|
&& players[displayplayer].mo && !players[displayplayer].spectator)
|
||||||
{
|
{
|
||||||
fixed_t scale = mobj->target->scale;
|
fixed_t scale = 4*mobj->target->scale;
|
||||||
|
|
||||||
if (!K_IsPlayerWanted(mobj->target->player))
|
if (!K_IsPlayerWanted(mobj->target->player))
|
||||||
{
|
{
|
||||||
|
@ -7023,10 +7023,13 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
P_SetThingPosition(mobj);
|
P_SetThingPosition(mobj);
|
||||||
|
|
||||||
|
if (!splitscreen)
|
||||||
|
{
|
||||||
scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
|
scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
|
||||||
players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale);
|
players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale);
|
||||||
if (scale > 16*FRACUNIT)
|
if (scale > 16*FRACUNIT)
|
||||||
scale = 16*FRACUNIT;
|
scale = 16*FRACUNIT;
|
||||||
|
}
|
||||||
mobj->destscale = scale;
|
mobj->destscale = scale;
|
||||||
}
|
}
|
||||||
else if (mobj->health > 0)
|
else if (mobj->health > 0)
|
||||||
|
|
69
src/p_user.c
69
src/p_user.c
|
@ -1217,6 +1217,8 @@ void P_RestoreMusic(player_t *player)
|
||||||
if (!P_IsLocalPlayer(player)) // Only applies to a local player
|
if (!P_IsLocalPlayer(player)) // Only applies to a local player
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
S_SpeedMusic(1.0f);
|
||||||
|
|
||||||
// Event - HERE COMES A NEW CHALLENGER
|
// Event - HERE COMES A NEW CHALLENGER
|
||||||
if (mapreset)
|
if (mapreset)
|
||||||
{
|
{
|
||||||
|
@ -1228,24 +1230,58 @@ void P_RestoreMusic(player_t *player)
|
||||||
if (P_EndingMusic(player))
|
if (P_EndingMusic(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
S_SpeedMusic(1.0f);
|
|
||||||
|
|
||||||
// Event - Level Start
|
// Event - Level Start
|
||||||
if (leveltime < (starttime + (TICRATE/2)))
|
if (leveltime < (starttime + (TICRATE/2)))
|
||||||
S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic();
|
S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic();
|
||||||
else // see also where time overs are handled - search for "lives = 2" in this file
|
else // see also where time overs are handled - search for "lives = 2" in this file
|
||||||
{
|
{
|
||||||
|
INT32 wantedmus = 0; // 0 is level music, 1 is invincibility, 2 is grow
|
||||||
|
|
||||||
|
if (splitscreen)
|
||||||
|
{
|
||||||
|
INT32 bestlocaltimer = 1;
|
||||||
|
|
||||||
|
#define setbests(p) \
|
||||||
|
if (players[p].playerstate == PST_LIVE) \
|
||||||
|
{ \
|
||||||
|
if (players[p].kartstuff[k_growshrinktimer] > bestlocaltimer) \
|
||||||
|
{ wantedmus = 2; bestlocaltimer = players[p].kartstuff[k_growshrinktimer]; } \
|
||||||
|
else if (players[p].kartstuff[k_invincibilitytimer] > bestlocaltimer) \
|
||||||
|
{ wantedmus = 1; bestlocaltimer = players[p].kartstuff[k_invincibilitytimer]; } \
|
||||||
|
}
|
||||||
|
setbests(displayplayer);
|
||||||
|
setbests(secondarydisplayplayer);
|
||||||
|
if (splitscreen > 1)
|
||||||
|
setbests(thirddisplayplayer);
|
||||||
|
if (splitscreen > 2)
|
||||||
|
setbests(fourthdisplayplayer);
|
||||||
|
#undef setbests
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (player->playerstate == PST_LIVE)
|
||||||
|
{
|
||||||
|
if (player->kartstuff[k_growshrinktimer] > 1)
|
||||||
|
wantedmus = 2;
|
||||||
|
else if (player->kartstuff[k_invincibilitytimer] > 1)
|
||||||
|
wantedmus = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Item - Grow
|
// Item - Grow
|
||||||
if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE)
|
if (wantedmus == 2)
|
||||||
S_ChangeMusicInternal("kgrow", true);
|
S_ChangeMusicInternal("kgrow", true);
|
||||||
// Item - Invincibility
|
// Item - Invincibility
|
||||||
else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE)
|
else if (wantedmus == 1)
|
||||||
S_ChangeMusicInternal("kinvnc", true);
|
S_ChangeMusicInternal("kinvnc", true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
// Event - Final Lap
|
// Event - Final Lap
|
||||||
|
// Still works for GME, but disabled for consistency
|
||||||
if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1))
|
if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1))
|
||||||
S_SpeedMusic(1.2f);
|
S_SpeedMusic(1.2f);
|
||||||
|
#endif
|
||||||
S_ChangeMusic(mapmusname, mapmusflags, true);
|
S_ChangeMusic(mapmusname, mapmusflags, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6652,13 +6688,24 @@ static void P_MovePlayer(player_t *player)
|
||||||
if (player->mo->state != &states[S_KART_SQUISH])
|
if (player->mo->state != &states[S_KART_SQUISH])
|
||||||
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
|
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
|
||||||
}
|
}
|
||||||
else if (player->kartstuff[k_spinouttimer] > 0 || player->pflags & PF_SLIDING)
|
else if (player->pflags & PF_SLIDING)
|
||||||
{
|
{
|
||||||
if (player->mo->state != &states[S_KART_SPIN])
|
if (player->mo->state != &states[S_KART_SPIN])
|
||||||
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||||
|
|
||||||
player->frameangle -= ANGLE_22h;
|
player->frameangle -= ANGLE_22h;
|
||||||
}
|
}
|
||||||
|
else if (player->kartstuff[k_spinouttimer] > 0)
|
||||||
|
{
|
||||||
|
INT32 speed = max(1, min(8, player->kartstuff[k_spinouttimer]/8));
|
||||||
|
|
||||||
|
if (player->mo->state != &states[S_KART_SPIN])
|
||||||
|
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||||
|
|
||||||
|
if (speed == 1 && abs(player->mo->angle - player->frameangle) < ANGLE_22h)
|
||||||
|
player->frameangle = player->mo->angle; // Face forward at the end of the animation
|
||||||
|
else
|
||||||
|
player->frameangle -= (ANGLE_11hh * speed);
|
||||||
|
}
|
||||||
else if (player->powers[pw_nocontrol] && player->pflags & PF_SKIDDOWN)
|
else if (player->powers[pw_nocontrol] && player->pflags & PF_SKIDDOWN)
|
||||||
{
|
{
|
||||||
if (player->mo->state != &states[S_KART_SPIN])
|
if (player->mo->state != &states[S_KART_SPIN])
|
||||||
|
@ -7335,7 +7382,7 @@ static void P_DoZoomTube(player_t *player)
|
||||||
fixed_t dist;
|
fixed_t dist;
|
||||||
boolean reverse;
|
boolean reverse;
|
||||||
|
|
||||||
player->mo->height = P_GetPlayerSpinHeight(player);
|
//player->mo->height = P_GetPlayerSpinHeight(player);
|
||||||
|
|
||||||
if (player->speed > 0)
|
if (player->speed > 0)
|
||||||
reverse = false;
|
reverse = false;
|
||||||
|
@ -7440,6 +7487,11 @@ static void P_DoZoomTube(player_t *player)
|
||||||
else if (player == &players[fourthdisplayplayer])
|
else if (player == &players[fourthdisplayplayer])
|
||||||
localangle4 = player->mo->angle;
|
localangle4 = player->mo->angle;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
if (player->mo->state != &states[S_KART_SPIN])
|
||||||
|
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||||
|
player->frameangle -= ANGLE_22h;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -8250,6 +8302,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
if (mo->eflags & MFE_VERTICALFLIP)
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
camheight += thiscam->height;
|
camheight += thiscam->height;
|
||||||
|
|
||||||
|
if (splitscreen == 1)
|
||||||
|
camspeed = (3*camspeed)/4;
|
||||||
|
|
||||||
if (timeover)
|
if (timeover)
|
||||||
angle = mo->angle + FixedAngle(camrotate*FRACUNIT);
|
angle = mo->angle + FixedAngle(camrotate*FRACUNIT);
|
||||||
else if (leveltime < starttime)
|
else if (leveltime < starttime)
|
||||||
|
|
|
@ -531,6 +531,9 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
||||||
pitch = NORM_PITCH;
|
pitch = NORM_PITCH;
|
||||||
priority = NORM_PRIORITY;
|
priority = NORM_PRIORITY;
|
||||||
|
|
||||||
|
if (splitscreen && origin)
|
||||||
|
volume = FixedDiv(volume<<FRACBITS, FixedSqrt((splitscreen+1)<<FRACBITS))>>FRACBITS;
|
||||||
|
|
||||||
if (splitscreen && listenmobj2) // Copy the sound for the split player
|
if (splitscreen && listenmobj2) // Copy the sound for the split player
|
||||||
{
|
{
|
||||||
// Check to see if it is audible, and if not, modify the params
|
// Check to see if it is audible, and if not, modify the params
|
||||||
|
@ -1011,6 +1014,9 @@ void S_UpdateSounds(void)
|
||||||
pitch = NORM_PITCH;
|
pitch = NORM_PITCH;
|
||||||
sep = NORM_SEP;
|
sep = NORM_SEP;
|
||||||
|
|
||||||
|
if (splitscreen && c->origin)
|
||||||
|
volume = FixedDiv(volume<<FRACBITS, FixedSqrt((splitscreen+1)<<FRACBITS))>>FRACBITS;
|
||||||
|
|
||||||
// check non-local sounds for distance clipping
|
// check non-local sounds for distance clipping
|
||||||
// or modify their params
|
// or modify their params
|
||||||
if (c->origin && ((c->origin != players[consoleplayer].mo)
|
if (c->origin && ((c->origin != players[consoleplayer].mo)
|
||||||
|
@ -1325,6 +1331,9 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v
|
||||||
*vol = (15 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS)) / S_ATTENUATOR;
|
*vol = (15 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS)) / S_ATTENUATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (splitscreen)
|
||||||
|
*vol = FixedDiv((*vol)<<FRACBITS, FixedSqrt((splitscreen+1)<<FRACBITS))>>FRACBITS;
|
||||||
|
|
||||||
return (*vol > 0);
|
return (*vol > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue