Merge branch 'sonicitems' into encore

This commit is contained in:
toaster 2018-08-15 16:12:42 +01:00
commit be1e43fc0b
2 changed files with 62 additions and 30 deletions

View file

@ -2840,6 +2840,13 @@ static void K_MoveHeldObjects(player_t *player)
if (!player->mo->hnext)
{
player->kartstuff[k_bananadrag] = 0;
if (player->kartstuff[k_eggmanheld])
player->kartstuff[k_eggmanheld] = 0;
else if (player->kartstuff[k_itemheld])
{
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE;
}
return;
}
@ -2848,6 +2855,13 @@ static void K_MoveHeldObjects(player_t *player)
// we need this here too because this is done in afterthink - pointers are cleaned up at the START of each tic...
P_SetTarget(&player->mo->hnext, NULL);
player->kartstuff[k_bananadrag] = 0;
if (player->kartstuff[k_eggmanheld])
player->kartstuff[k_eggmanheld] = 0;
else if (player->kartstuff[k_itemheld])
{
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE;
}
return;
}
@ -3718,6 +3732,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player->kartstuff[k_rocketsneakertimer] < 1)
player->kartstuff[k_rocketsneakertimer] = 1;
}
else if (player->kartstuff[k_itemamount] <= 0)
{
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
}
else
{
switch (player->kartstuff[k_itemtype])
@ -3770,6 +3788,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++)
{
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BANANA_SHIELD);
if (!mo)
{
player->kartstuff[k_itemamount] = moloop;
break;
}
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = player->kartstuff[k_itemamount];
@ -3784,8 +3807,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_ThrowKartItem(player, false, MT_BANANA, -1, false);
K_PlayTauntSound(player->mo);
player->kartstuff[k_itemamount]--;
if (!player->kartstuff[k_itemamount])
if (!(--player->kartstuff[k_itemamount]))
player->kartstuff[k_itemheld] = 0;
}
break;
@ -3797,12 +3819,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->kartstuff[k_eggmanheld] = 1;
S_StartSound(player->mo, sfx_s254);
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FAKESHIELD);
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = 1;
mo->lastlook = 1;
if (mo)
{
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = 1;
mo->lastlook = 1;
P_SetTarget(&mo->target, player->mo);
P_SetTarget(&player->mo->hnext, mo);
}
@ -3828,6 +3850,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 64*FRACUNIT);
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 64*FRACUNIT);
mo = P_SpawnMobj(newx, newy, player->mo->z, MT_ORBINAUT_SHIELD);
if (!mo)
{
player->kartstuff[k_itemamount] = moloop;
break;
}
mo->flags |= MF_NOCLIPTHING;
mo->angle = newangle;
mo->threshold = 10;
@ -3845,8 +3872,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_ThrowKartItem(player, true, MT_ORBINAUT, 1, false);
K_PlayTauntSound(player->mo);
player->kartstuff[k_itemamount]--;
if (!player->kartstuff[k_itemamount])
if (!(--player->kartstuff[k_itemamount]))
player->kartstuff[k_itemheld] = 0;
}
break;
@ -3870,6 +3896,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 64*FRACUNIT);
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 64*FRACUNIT);
mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD);
if (!mo)
{
player->kartstuff[k_itemamount] = moloop;
break;
}
mo->flags |= MF_NOCLIPTHING;
mo->angle = newangle;
mo->threshold = 10;
@ -3889,8 +3920,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false);
K_PlayTauntSound(player->mo);
player->kartstuff[k_itemamount]--;
if (!player->kartstuff[k_itemamount])
if (!(--player->kartstuff[k_itemamount]))
player->kartstuff[k_itemheld] = 0;
}
break;
@ -3901,12 +3931,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->kartstuff[k_itemheld] = 1;
S_StartSound(player->mo, sfx_s254);
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SSMINE_SHIELD);
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = 1;
mo->lastlook = 1;
if (mo)
{
mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10;
mo->movecount = 1;
mo->lastlook = 1;
P_SetTarget(&mo->target, player->mo);
P_SetTarget(&player->mo->hnext, mo);
}
@ -5056,7 +5086,7 @@ static void K_drawKartItem(void)
V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, localpatch);
// Extensible meter, currently only used for rocket sneaker...
if (itembar)
if (itembar && hudtrans)
{
const INT32 barlength = (splitscreen > 1 ? 12 : 24);
const INT32 max = itemtime; // timer's normal highest value
@ -5066,14 +5096,14 @@ static void K_drawKartItem(void)
V_DrawScaledPatch(ITEM_X+x, ITEM_Y+y, V_HUDTRANS|splitflags, kp_itemtimer[offset]);
// The left dark "AA" edge
V_DrawFill(ITEM_X+x+1, ITEM_Y+y+1, (length == 2 ? 2 : 1), height, 12);
V_DrawFill(ITEM_X+x+1, ITEM_Y+y+1, (length == 2 ? 2 : 1), height, 12|splitflags);
// The bar itself
if (length > 2)
{
V_DrawFill(ITEM_X+x+length, ITEM_Y+y+1, 1, height, 12); // the right one
V_DrawFill(ITEM_X+x+length, ITEM_Y+y+1, 1, height, 12|splitflags); // the right one
if (height == 2)
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+2, length-2, 1, 8); // the dulled underside
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-2, 1, 120); // the shine
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+2, length-2, 1, 8|splitflags); // the dulled underside
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-2, 1, 120|splitflags); // the shine
}
}

View file

@ -929,12 +929,13 @@ static menuitem_t MP_MainMenu[] =
static menuitem_t MP_ServerMenu[] =
{
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10},
{IT_STRING|IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 10},
#ifndef NONET
{IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20},
{IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30},
#endif
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 68},
{IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78},
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130},
@ -943,19 +944,20 @@ static menuitem_t MP_ServerMenu[] =
// Separated splitscreen and normal servers.
static menuitem_t MP_SplitServerMenu[] =
{
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10},
#ifndef NOFOURPLAYER
{IT_STRING|IT_CVAR, NULL, "Number of players", &cv_dummysplitplayers, 20},
{IT_STRING|IT_CVAR, NULL, "Number of players", &cv_dummysplitplayers, 10},
#endif
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 68},
{IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78},
#ifdef NOFOURPLAYER
{IT_STRING|IT_CALL, NULL, "P1 Setup...", M_SetupMultiPlayer, 108},
{IT_STRING|IT_CALL, NULL, "P2 Setup... ", M_SetupMultiPlayer2, 118},
{IT_STRING|IT_CALL, NULL, "P1 Setup...", M_SetupMultiPlayer, 110},
{IT_STRING|IT_CALL, NULL, "P2 Setup... ", M_SetupMultiPlayer2, 120},
#else
{IT_STRING|IT_CALL, NULL, "P1 Setup...", M_SetupMultiPlayer, 88},
{IT_STRING|IT_CALL, NULL, "P2 Setup... ", M_SetupMultiPlayer2, 98},
{IT_GRAYEDOUT, NULL, "P3 Setup...", M_SetupMultiPlayer3, 108},
{IT_GRAYEDOUT, NULL, "P4 Setup... ", M_SetupMultiPlayer4, 118},
{IT_STRING|IT_CALL, NULL, "P1 Setup...", M_SetupMultiPlayer, 90},
{IT_STRING|IT_CALL, NULL, "P2 Setup... ", M_SetupMultiPlayer2, 100},
{IT_GRAYEDOUT, NULL, "P3 Setup...", M_SetupMultiPlayer3, 110},
{IT_GRAYEDOUT, NULL, "P4 Setup... ", M_SetupMultiPlayer4, 120},
#endif
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130},
};
@ -1474,7 +1476,7 @@ static menuitem_t OP_ServerOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60},
#ifndef NONET
{IT_STRING | IT_CVAR, NULL, "Max Player Count", &cv_maxplayers, 80},
{IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 80},
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90},
//{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 100},
@ -6921,7 +6923,7 @@ static void M_DrawServerMenu(void)
3*
#endif
incrwidth;
INT32 x = BASEVIDWIDTH/2 - paw/2, y = currentMenu->y + 32, trans = 0;
INT32 x = BASEVIDWIDTH/2 - paw/2, y = currentMenu->y + 27, trans = 0;
patch_t *face;
while (++i <=