Merge branch 'sonicitems' into encore

This commit is contained in:
TehRealSalt 2018-08-26 00:12:02 -04:00
commit 277c4deb30
8 changed files with 135 additions and 83 deletions

2
objs/Mingw/SDL/Release/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

View File

@ -2186,10 +2186,10 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
const UINT8 *colormap;
//this function is designed for 9 or less score lines only
I_Assert(scorelines <= 9);
//I_Assert(scorelines <= 9); -- not today bitch, kart fixed it up
V_DrawFill(1, 26, 318, 1, 0); // Draw a horizontal line because it looks nice!
if (scorelines > 9)
if (scorelines > 8)
{
V_DrawFill(160, 26, 1, 154, 0); // Draw a vertical line to separate the two sides.
V_DrawFill(1, 180, 318, 1, 0); // And a horizontal line near the bottom.
@ -2198,6 +2198,8 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
for (i = 0; i < scorelines; i++)
{
char strtime[MAXPLAYERNAME+1];
if (players[tab[i].num].spectator || !players[tab[i].num].mo)
continue; //ignore them.
@ -2207,11 +2209,16 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false);
}
if (scorelines > 8)
strlcpy(strtime, tab[i].name, 6);
else
STRBUFCPY(strtime, tab[i].name);
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer)
? hilicol|V_ALLOWLOWERCASE
: V_ALLOWLOWERCASE),
tab[i].name);
strtime);
if (players[tab[i].num].mo->color)
{
@ -2260,7 +2267,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
V_DrawRightAlignedString(x+rightoffset, y, 0, va("%u", tab[i].count));
y += 16;
if (i == 9)
if (i == 7)
{
y = 32;
x += BASEVIDWIDTH/2;
@ -2680,15 +2687,17 @@ static void HU_DrawRankings(void)
tab[scorelines].count = players[i].marescore;
scorelines++;
}
if (scorelines > 20)
scorelines = 20; //dont draw past bottom of screen, show the best only
#if MAXPLAYERS > 16
if (scorelines > 16)
break; //dont draw past bottom of screen, show the best only
#endif
}
/*if (G_GametypeHasTeams())
HU_DrawTeamTabRankings(tab, whiteplayer); //separate function for Spazzo's silly request -- gotta fix this up later
else if (scorelines > 10)*/
HU_DrawTabRankings(((scorelines > 9) ? 32 : 40), 32, tab, scorelines, whiteplayer, hilicol);
HU_DrawTabRankings(((scorelines > 8) ? 32 : 40), 32, tab, scorelines, whiteplayer, hilicol);
/*else
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);*/

View File

@ -1583,9 +1583,9 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
if (player->kartstuff[k_pogospring]) // Pogo Spring minimum/maximum thrust
{
const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
const fixed_t minspeed = 24*scale;
const fixed_t maxspeed = 36*scale;
const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - player->mo->scale);
const fixed_t minspeed = 24*hscale;
const fixed_t maxspeed = 36*hscale;
if (newspeed > maxspeed && player->kartstuff[k_pogospring] == 2)
newspeed = maxspeed;
@ -2712,7 +2712,7 @@ static void K_DoSPB(player_t *victim, player_t *source)
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
{
fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
if (mo->player && mo->player->spectator)
return;
@ -2757,10 +2757,10 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
thrust = 32<<FRACBITS;
}
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, scale));
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, vscale));
}
else
mo->momz = FixedMul(vertispeed, scale);
mo->momz = FixedMul(vertispeed, vscale);
if (!mute)
S_StartSound(mo, sfx_kc2f);
@ -2792,6 +2792,48 @@ killnext:
goto killnext;
}
// Just for firing/dropping items.
void K_CleanHnextList(mobj_t *work)
{
mobj_t *nextwork;
if (!work)
return;
work = work->hnext;
while (work && !P_MobjWasRemoved(work))
{
nextwork = work->hnext;
P_RemoveMobj(work);
work = nextwork;
}
}
// Ditto.
void K_UpdateHnextList(player_t *player)
{
mobj_t *work = player->mo, *nextwork;
if (!work)
return;
work = work->hnext;
while (work && !P_MobjWasRemoved(work))
{
nextwork = work->hnext;
if (work->movedir > 0 && work->movedir > (UINT16)player->kartstuff[k_itemamount])
P_RemoveMobj(work);
work = nextwork;
}
}
// When an item in the hnext chain dies.
void K_RepairOrbitChain(mobj_t *orbit)
{
mobj_t *cachenext = orbit->hnext;
@ -2832,6 +2874,7 @@ void K_RepairOrbitChain(mobj_t *orbit)
}
}
// Move the hnext chain!
static void K_MoveHeldObjects(player_t *player)
{
if (!player->mo)
@ -3657,6 +3700,8 @@ void K_StripItems(player_t *player)
player->kartstuff[k_bananadrag] = 0;
player->kartstuff[k_sadtimer] = 0;
K_CleanHnextList(player->mo);
}
//
@ -3722,6 +3767,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_ThrowKartItem(player, false, MT_FAKEITEM, -1, false);
K_PlayTauntSound(player->mo);
player->kartstuff[k_eggmanheld] = 0;
K_CleanHnextList(player->mo);
}
// Rocket Sneaker
else if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO
@ -3796,7 +3842,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = player->kartstuff[k_itemamount];
mo->lastlook = moloop+1;
mo->movedir = moloop+1;
P_SetTarget(&mo->target, player->mo);
P_SetTarget(&mo->hprev, prev);
P_SetTarget(&prev->hnext, mo);
@ -3807,8 +3853,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_ThrowKartItem(player, false, MT_BANANA, -1, false);
K_PlayTauntSound(player->mo);
if (!(--player->kartstuff[k_itemamount]))
player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemamount]--;
K_UpdateHnextList(player);
}
break;
case KITEM_EGGMAN:
@ -3824,7 +3870,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = 1;
mo->lastlook = 1;
mo->movedir = 1;
P_SetTarget(&mo->target, player->mo);
P_SetTarget(&player->mo->hnext, mo);
}
@ -3871,9 +3917,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_ThrowKartItem(player, true, MT_ORBINAUT, 1, false);
K_PlayTauntSound(player->mo);
if (!(--player->kartstuff[k_itemamount]))
player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemamount]--;
K_UpdateHnextList(player);
}
break;
case KITEM_JAWZ:
@ -3919,9 +3964,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in
K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false);
K_PlayTauntSound(player->mo);
if (!(--player->kartstuff[k_itemamount]))
player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemamount]--;
K_UpdateHnextList(player);
}
break;
case KITEM_MINE:
@ -3936,7 +3980,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = 1;
mo->lastlook = 1;
mo->movedir = 1;
P_SetTarget(&mo->target, player->mo);
P_SetTarget(&player->mo->hnext, mo);
}
@ -3947,6 +3991,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_PlayTauntSound(player->mo);
player->kartstuff[k_itemamount]--;
player->kartstuff[k_itemheld] = 0;
K_CleanHnextList(player->mo);
}
break;
case KITEM_BALLHOG:
@ -4073,8 +4118,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
}
// No more!
if (!player->kartstuff[k_itemamount] && !player->kartstuff[k_itemheld])
if (!player->kartstuff[k_itemamount])
{
player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE;
}
if (player->kartstuff[k_itemtype] != KITEM_THUNDERSHIELD)
player->kartstuff[k_curshield] = 0;
@ -4999,7 +5047,7 @@ static void K_drawKartItem(void)
{
if (leveltime & 2)
localpatch = kp_hyudoro[offset];
else if (!(leveltime & 2))
else
localpatch = kp_nodraw;
}
else if ((stplyr->kartstuff[k_stealingtimer] > 0) && (leveltime & 2))
@ -5010,7 +5058,7 @@ static void K_drawKartItem(void)
{
if (leveltime & 1)
localpatch = kp_eggman[offset];
else if (!(leveltime & 1))
else
localpatch = kp_nodraw;
}
else if (stplyr->kartstuff[k_rocketsneakertimer] > 1)
@ -5018,26 +5066,26 @@ static void K_drawKartItem(void)
itembar = stplyr->kartstuff[k_rocketsneakertimer];
if (leveltime & 1)
localpatch = kp_rocketsneaker[offset];
else if (!(leveltime & 1))
else
localpatch = kp_nodraw;
}
else if (stplyr->kartstuff[k_growshrinktimer] > 1)
{
if (leveltime & 1)
localpatch = kp_grow[offset];
else if (!(leveltime & 1))
else
localpatch = kp_nodraw;
}
else if (stplyr->kartstuff[k_sadtimer] > 0)
{
if (leveltime & 2)
localpatch = kp_sadface[offset];
else if (!(leveltime & 2))
else
localpatch = kp_nodraw;
}
else
{
if (!(stplyr->kartstuff[k_itemamount] || stplyr->kartstuff[k_itemheld]))
if (stplyr->kartstuff[k_itemamount] <= 0)
return;
switch(stplyr->kartstuff[k_itemtype])

View File

@ -39,6 +39,8 @@ void K_DriftDustHandling(mobj_t *spawner);
void K_DoSneaker(player_t *player, boolean doPFlag);
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute);
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
void K_CleanHnextList(mobj_t *work);
void K_UpdateHnextList(player_t *player);
void K_RepairOrbitChain(mobj_t *orbit);
boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y);
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);

View File

@ -2221,7 +2221,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) // trail items
|| (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))
{
if (target->lastlook != 0 && target->lastlook < target->target->player->kartstuff[k_itemamount])
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
{
if (target->target->hnext)
K_KillBananaChain(target->target->hnext, inflictor, source);

View File

@ -116,7 +116,8 @@ boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z)
boolean P_DoSpring(mobj_t *spring, mobj_t *object)
{
//INT32 pflags;
const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(object->scale - mapheaderinfo[gamemap-1]->mobj_scale); //max(mapheaderinfo[gamemap-1]->mobj_scale, object->scale)
const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - object->scale);
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (object->scale - mapheaderinfo[gamemap-1]->mobj_scale);
fixed_t offx, offy;
fixed_t vertispeed = spring->info->mass;
fixed_t horizspeed = spring->info->damage;
@ -179,12 +180,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
}
if (vertispeed)
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(scale, spring->scale)));
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale)));
if (horizspeed)
{
if (!object->player)
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(scale, spring->scale))));
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale))));
else
{
fixed_t finalSpeed = horizspeed;
@ -193,7 +194,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (pSpeed > finalSpeed)
finalSpeed = pSpeed;
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(scale, spring->scale))));
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale))));
}
}

View File

@ -6715,12 +6715,15 @@ void P_MobjThinker(mobj_t *mobj)
}
break;
}
case MT_ORBINAUT_SHIELD: // Kart orbit items
case MT_ORBINAUT_SHIELD: // Kart orbit/trail items
case MT_JAWZ_SHIELD:
if (mobj->health > 0 && mobj->target && mobj->target->player
case MT_BANANA_SHIELD:
case MT_SSMINE_SHIELD:
case MT_FAKESHIELD:
/*if (mobj->health > 0 && mobj->target && mobj->target->player
&& mobj->target->player->health > 0 && !mobj->target->player->spectator)
{
// Was this so hard?
// Was this so hard? -- Handled this with K_UpdateHnextList and K_ClearHnextList instead of thinking it away...
if ((mobj->type == MT_ORBINAUT_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT)
|| (mobj->type == MT_JAWZ_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ)
|| (mobj->movedir > 0 && ((UINT16)mobj->target->player->kartstuff[k_itemamount] < mobj->movedir))
@ -6730,33 +6733,7 @@ void P_MobjThinker(mobj_t *mobj)
return;
}
}
else if ((mobj->health > 0
&& (!mobj->target || !mobj->target->player || mobj->target->player->health <= 0 || mobj->target->player->spectator))
|| (mobj->health <= 0 && mobj->z <= mobj->floorz)
|| P_CheckDeathPitCollide(mobj)) // When in death state
{
P_RemoveMobj(mobj);
return;
}
break;
case MT_BANANA_SHIELD: // Kart trailing items
case MT_SSMINE_SHIELD:
case MT_FAKESHIELD:
if (mobj->health > 0 && mobj->target && mobj->target->player
&& mobj->target->player->health > 0 && !mobj->target->player->spectator)
{
// Was this so hard?
if ((mobj->type == MT_BANANA_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA)
|| (mobj->type == MT_SSMINE_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_MINE)
|| (mobj->type == MT_FAKESHIELD && !mobj->target->player->kartstuff[k_eggmanheld])
|| (mobj->type != MT_FAKESHIELD && (!mobj->target->player->kartstuff[k_itemheld]
|| (mobj->lastlook > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->lastlook))))
{
P_RemoveMobj(mobj);
return;
}
}
else if ((mobj->health > 0
else*/ if ((mobj->health > 0
&& (!mobj->target || !mobj->target->player || mobj->target->player->health <= 0 || mobj->target->player->spectator))
|| (mobj->health <= 0 && mobj->z <= mobj->floorz)
|| P_CheckDeathPitCollide(mobj)) // When in death state
@ -6973,10 +6950,10 @@ void P_MobjThinker(mobj_t *mobj)
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_HYUDORO;
if (!(leveltime & 2))
mobj->tracer->flags2 |= MF2_DONTDRAW;
else
if (leveltime & 2)
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
else
mobj->tracer->flags2 |= MF2_DONTDRAW;
}
else if ((mobj->target->player->kartstuff[k_stealingtimer] > 0) && (leveltime & 2))
{
@ -6991,9 +6968,20 @@ void P_MobjThinker(mobj_t *mobj)
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_EGGMAN;
if (leveltime & 1)
mobj->tracer->flags2 |= MF2_DONTDRAW;
else
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
else
mobj->tracer->flags2 |= MF2_DONTDRAW;
}
else if (stplyr->kartstuff[k_rocketsneakertimer] > 1)
{
//itembar = stplyr->kartstuff[k_rocketsneakertimer]; -- not today satan
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_ROCKETSNEAKER;
if (leveltime & 1)
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
else
mobj->tracer->flags2 |= MF2_DONTDRAW;
}
else if (mobj->target->player->kartstuff[k_growshrinktimer] > 0)
{
@ -7002,11 +6990,11 @@ void P_MobjThinker(mobj_t *mobj)
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW;
if (leveltime & 1)
mobj->tracer->flags2 |= MF2_DONTDRAW;
else
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
else
mobj->tracer->flags2 |= MF2_DONTDRAW;
}
else if (mobj->target->player->kartstuff[k_itemtype])
else if (mobj->target->player->kartstuff[k_itemtype] && mobj->target->player->kartstuff[k_itemamount] > 0)
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);

View File

@ -401,7 +401,6 @@ void Y_IntermissionDrawer(void)
else*/ if (intertype == int_race || intertype == int_match)
{
INT32 y = 48;
char name[MAXPLAYERNAME+1];
const char *timeheader;
if (data.match.rankingsmode)
@ -418,7 +417,7 @@ void Y_IntermissionDrawer(void)
if (data.match.numplayers > 8)
{
V_DrawFill(160, 32, 1, 152, 0);
V_DrawFill(x+156, 32, 1, 152, 0);
V_DrawCenteredString(x+6+(BASEVIDWIDTH/2), 32, hilicol, "#");
V_DrawString(x+36+(BASEVIDWIDTH/2), 32, hilicol, "NAME");
@ -435,7 +434,7 @@ void Y_IntermissionDrawer(void)
{
if (data.match.num[i] != MAXPLAYERS && playeringame[data.match.num[i]] && !players[data.match.num[i]].spectator)
{
char strtime[10];
char strtime[MAXPLAYERNAME+1];
V_DrawCenteredString(x+6, y, 0, va("%d", data.match.pos[i]));
@ -447,16 +446,16 @@ void Y_IntermissionDrawer(void)
V_DrawSmallMappedPatch(x+16, y-4, 0,faceprefix[*data.match.character[i]], colormap);
}
if (data.match.numplayers > 9)
strlcpy(name, data.match.name[i], 6);
if (data.match.numplayers > 8)
strlcpy(strtime, data.match.name[i], 6);
else
STRBUFCPY(name, data.match.name[i]);
STRBUFCPY(strtime, data.match.name[i]);
V_DrawString(x+36, y,
((data.match.num[i] == whiteplayer)
? hilicol|V_ALLOWLOWERCASE
: V_ALLOWLOWERCASE),
name);
strtime);
if (data.match.rankingsmode)
{
@ -515,11 +514,14 @@ void Y_IntermissionDrawer(void)
}
}
else
{
data.match.increase[data.match.num[i]] = 0;
data.match.num[i] = MAXPLAYERS; // this should be the only field setting in this function
}
y += 16;
if (y > 176)
if (i == 7)
{
y = 48;
x += BASEVIDWIDTH/2;