Intro camera can noclip, fix several compile errors

This commit is contained in:
SeventhSentinel 2018-06-25 09:18:30 -04:00
parent 6b222c4935
commit 7fdc9c8035
9 changed files with 46 additions and 30 deletions

View File

@ -540,4 +540,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
#define SECTORSPECIALSAFTERTHINK
/// SRB2Kart: Camera always has noclip.
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
//#define NOCLIPCAM
#endif // __DOOMDEF__

View File

@ -409,6 +409,7 @@ extern UINT16 spacetimetics;
extern UINT16 extralifetics;
// SRB2kart
extern tic_t introtime;
extern tic_t starttime;
extern INT32 hyudorotime;
extern INT32 stealtime;

View File

@ -207,6 +207,7 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2);
UINT16 extralifetics = 4*TICRATE;
// SRB2kart
tic_t introtime = 108;
tic_t starttime = 6*TICRATE + (3*TICRATE/4);
INT32 hyudorotime = 7*TICRATE;
INT32 stealtime = TICRATE/2;
@ -2974,6 +2975,8 @@ boolean G_IsSpecialStage(INT32 mapnum)
#if 0
if (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end)
return true;
#else
(void)mapnum;
#endif
return false;
}

View File

@ -538,7 +538,7 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem)
\return void
*/
static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean mashed)
static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, boolean mashed)
{
const INT32 distvar = (64*14);
INT32 newodds;
@ -771,7 +771,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
for (j = 0; j < NUMKARTRESULTS; j++)
{
if (K_KartGetItemOdds(i, j, player, mashed) > 0)
if (K_KartGetItemOdds(i, j, mashed) > 0)
{
available = 1;
break;
@ -810,8 +810,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
UINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average
if (wantedpos > 4)
wantedpos = 4;
if (wantedpos < 0)
wantedpos = 0;
/*if (wantedpos < 0)
wantedpos = 0;*/
useodds = disttable[(wantedpos * distlen) / 5];
}
}
@ -853,7 +853,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
//CONS_Printf("Got useodds %d. (position: %d, distance: %d)\n", useodds, player->kartstuff[k_position], pdis);
#define SETITEMRESULT(pos, itemnum) \
for (chance = 0; chance < K_KartGetItemOdds(pos, itemnum, player, mashed); chance++) \
for (chance = 0; chance < K_KartGetItemOdds(pos, itemnum, mashed); chance++) \
spawnchance[numchoices++] = itemnum
SETITEMRESULT(useodds, KITEM_SNEAKER); // Sneaker
@ -2438,7 +2438,9 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed)
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
{
if (banana->hnext)
{
K_KillBananaChain(banana->hnext, inflictor, source);
}
if (banana->health)
{
@ -3715,7 +3717,6 @@ void K_LoadKartHUDGraphics(void)
{
for (j = 0; j < NUMPOSFRAMES; j++)
{
//if (i > 4 && j < 4 && j != 0) continue; // We don't need blue numbers for ranks past 4th
sprintf(buffer, "K_POSN%d%d", i, j);
kp_positionnum[i][j] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
}

View File

@ -4332,14 +4332,15 @@ static char *M_GetConditionString(condition_t cond)
case UC_EXTRAEMBLEM:
return va("Get \"%s\" emblem", extraemblems[cond.requirement-1].name);
default:
return "";
return NULL;
}
}
#define NUMCHECKLIST 23
static void M_DrawChecklist(void)
{
INT32 i, line = 0, c, lastid;
UINT32 i, line = 0, c;
INT32 lastid;
for (i = 0; i < MAXUNLOCKABLES; i++)
{
@ -4366,7 +4367,7 @@ static void M_DrawChecklist(void)
++line;
if (cond.id != lastid)
if (lastid == -1 || cond.id != (UINT32)lastid)
{
V_DrawString(16, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), "*");
V_DrawString(32, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), str);

View File

@ -338,6 +338,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
boolean P_Move(mobj_t *actor, fixed_t speed);
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
void P_SlideMove(mobj_t *mo, boolean forceslide);
void P_BouncePlayerMove(mobj_t *mo);
void P_BounceMove(mobj_t *mo);
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius);

View File

@ -2516,10 +2516,13 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
fixed_t tryx = thiscam->x;
fixed_t tryy = thiscam->y;
#ifndef NOCLIPCAM
if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP))
|| (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP))
|| (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP))
|| (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)))
|| (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP))
|| (leveltime < introtime))
#endif
{ // Noclipping player camera noclips too!!
floatok = true;
thiscam->floorz = thiscam->z;
@ -3823,12 +3826,12 @@ stairstep:
}
//
// P_PlayerBounceMove
// P_BouncePlayerMove
//
// Bounce move, for players.
//
void P_PlayerBounceMove(mobj_t *mo)
void P_BouncePlayerMove(mobj_t *mo)
{
fixed_t leadx, leady;
fixed_t trailx, traily;
@ -3944,7 +3947,7 @@ void P_BounceMove(mobj_t *mo)
if (mo->player)
{
P_PlayerBounceMove(mo);
P_BouncePlayerMove(mo);
return;
}

View File

@ -3678,7 +3678,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
dummy.y = thiscam->y;
dummy.z = thiscam->z;
dummy.height = thiscam->height;
if (!resetcalled && !(player->pflags & PF_NOCLIP) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
P_ResetCamera(player, thiscam);
else
P_SlideCameraMove(thiscam);
@ -3699,7 +3699,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
// adjust height
thiscam->z += thiscam->momz + player->mo->pmomz;
if (!itsatwodlevel && !(player->pflags & PF_NOCLIP))
#ifndef NOCLIPCAM
if (!itsatwodlevel && !(player->pflags & PF_NOCLIP || leveltime < introtime))
{
// clip movement
if (thiscam->z <= thiscam->floorz) // hit the floor
@ -3739,6 +3740,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
}
}
}
#endif
}
if (itsatwodlevel
@ -9337,13 +9339,7 @@ void P_RemoveMobj(mobj_t *mobj)
iquetail = (iquetail+1)&(ITEMQUESIZE-1);
}
if (mobj->type == MT_OVERLAY)
P_RemoveOverlay(mobj);
if (mobj->type == MT_SHADOW)
P_RemoveShadow(mobj);
if (mobj->type == MT_KARMAHITBOX)
if (mobj->type == MT_KARMAHITBOX) // Remove linked list objects for certain types
{
mobj_t *cur = mobj->hnext;
@ -9355,6 +9351,12 @@ void P_RemoveMobj(mobj_t *mobj)
}
}
if (mobj->type == MT_OVERLAY)
P_RemoveOverlay(mobj);
if (mobj->type == MT_SHADOW)
P_RemoveShadow(mobj);
mobj->health = 0; // Just because
// unlink from sector and block lists

View File

@ -8136,12 +8136,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
subsector_t *newsubsec;
fixed_t f1, f2;
#if 1
#ifdef NOCLIPCAM
cameranoclip = true; // We like camera noclip!
#else
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|| (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT))
|| (leveltime < 3*TICRATE)); // Noclipping player camera noclips too!!
|| (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|| (leveltime < introtime)); // Kart intro cam
#endif
if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD))
@ -8276,12 +8276,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
lookback = camspin4;
}
if (leveltime < 3*TICRATE) // Whoooshy camera!
if (leveltime < introtime) // Whoooshy camera!
{
const INT32 introcam = (3*TICRATE - leveltime) * 3;
camrotate += 3*introcam/2;
camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale);
camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale);
const INT32 introcam = (introtime - leveltime);
camrotate += introcam*5;
camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale)*3;
camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale)*2;
}
else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect!
camstill = true;