mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-19 14:32:34 +00:00
Delete everything major flagged up by listunusedsprites
Notable deletions:
- Metal Sonic Race
- Includes all the specialised recording/playback apparatus which made g_demo.c harder to read
- A bunch of hyperspecialised code inside several A_ actions
- EXCEPTION: intentfully left in the spriteless SMK stuff for Sal's add-on down the line.
This commit is contained in:
parent
8733f16a72
commit
325079a39a
27 changed files with 118 additions and 20212 deletions
|
|
@ -931,7 +931,7 @@ boolean CON_Responder(event_t *ev)
|
||||||
if (ev->type != ev_console)
|
if (ev->type != ev_console)
|
||||||
{
|
{
|
||||||
#ifndef DEVELOP // I have driven this course 45 times and I just want to give myself rocketsneakers
|
#ifndef DEVELOP // I have driven this course 45 times and I just want to give myself rocketsneakers
|
||||||
if (modeattacking || metalrecording || marathonmode)
|
if (modeattacking || marathonmode)
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2631,10 +2631,6 @@ void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
|
||||||
|
|
||||||
void CL_Reset(void)
|
void CL_Reset(void)
|
||||||
{
|
{
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalRecording(false);
|
|
||||||
if (metalplayback)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
if (demo.recording)
|
if (demo.recording)
|
||||||
G_CheckDemoStatus();
|
G_CheckDemoStatus();
|
||||||
|
|
||||||
|
|
@ -3912,8 +3908,6 @@ boolean SV_SpawnServer(void)
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (demo.playback)
|
if (demo.playback)
|
||||||
G_StopDemo(); // reset engine parameter
|
G_StopDemo(); // reset engine parameter
|
||||||
if (metalplayback)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
|
|
||||||
if (!serverrunning)
|
if (!serverrunning)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1850,12 +1850,7 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
// check for a driver that wants intermission stats
|
// check for a driver that wants intermission stats
|
||||||
// start the apropriate game based on parms
|
// start the apropriate game based on parms
|
||||||
if (M_CheckParm("-metal"))
|
if (M_CheckParm("-record") && M_IsNextParm())
|
||||||
{
|
|
||||||
G_RecordMetal();
|
|
||||||
autostart = true;
|
|
||||||
}
|
|
||||||
else if (M_CheckParm("-record") && M_IsNextParm())
|
|
||||||
{
|
{
|
||||||
G_RecordDemo(M_GetNextParm());
|
G_RecordDemo(M_GetNextParm());
|
||||||
autostart = true;
|
autostart = true;
|
||||||
|
|
|
||||||
|
|
@ -2020,8 +2020,6 @@ static void Command_Playdemo_f(void)
|
||||||
// disconnect from server here?
|
// disconnect from server here?
|
||||||
if (demo.playback)
|
if (demo.playback)
|
||||||
G_StopDemo();
|
G_StopDemo();
|
||||||
if (metalplayback)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
|
|
||||||
// open the demo file
|
// open the demo file
|
||||||
strcpy(name, COM_Argv(1));
|
strcpy(name, COM_Argv(1));
|
||||||
|
|
@ -2059,8 +2057,6 @@ static void Command_Timedemo_f(void)
|
||||||
// disconnect from server here?
|
// disconnect from server here?
|
||||||
if (demo.playback)
|
if (demo.playback)
|
||||||
G_StopDemo();
|
G_StopDemo();
|
||||||
if (metalplayback)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
|
|
||||||
// open the demo file
|
// open the demo file
|
||||||
strcpy (timedemo_name, COM_Argv(1));
|
strcpy (timedemo_name, COM_Argv(1));
|
||||||
|
|
|
||||||
2431
src/deh_tables.c
2431
src/deh_tables.c
File diff suppressed because it is too large
Load diff
|
|
@ -193,7 +193,6 @@ extern UINT16 musicwads;
|
||||||
extern boolean savemoddata; // This mod saves time/emblem data.
|
extern boolean savemoddata; // This mod saves time/emblem data.
|
||||||
extern boolean usedCheats;
|
extern boolean usedCheats;
|
||||||
extern boolean imcontinuing; // Temporary flag while continuing
|
extern boolean imcontinuing; // Temporary flag while continuing
|
||||||
extern boolean metalrecording;
|
|
||||||
|
|
||||||
#define ATTACKING_NONE 0
|
#define ATTACKING_NONE 0
|
||||||
#define ATTACKING_TIME 1
|
#define ATTACKING_TIME 1
|
||||||
|
|
|
||||||
508
src/g_demo.c
508
src/g_demo.c
|
|
@ -68,12 +68,6 @@ boolean demosynced = true; // console warning message
|
||||||
|
|
||||||
struct demovars_s demo;
|
struct demovars_s demo;
|
||||||
|
|
||||||
boolean metalrecording; // recording as metal sonic
|
|
||||||
mobj_t *metalplayback;
|
|
||||||
static UINT8 *metalbuffer = NULL;
|
|
||||||
static UINT8 *metal_p;
|
|
||||||
static UINT16 metalversion;
|
|
||||||
|
|
||||||
// extra data stuff (events registered this frame while recording)
|
// extra data stuff (events registered this frame while recording)
|
||||||
static struct {
|
static struct {
|
||||||
UINT8 flags; // EZT flags
|
UINT8 flags; // EZT flags
|
||||||
|
|
@ -152,9 +146,6 @@ UINT8 demo_extradata[MAXPLAYERS];
|
||||||
UINT8 demo_writerng; // 0=no, 1=yes, 2=yes but on a timeout
|
UINT8 demo_writerng; // 0=no, 1=yes, 2=yes but on a timeout
|
||||||
static ticcmd_t oldcmd[MAXPLAYERS];
|
static ticcmd_t oldcmd[MAXPLAYERS];
|
||||||
|
|
||||||
#define METALDEATH 0x44
|
|
||||||
#define METALSNICE 0x69
|
|
||||||
|
|
||||||
#define DW_END 0xFF // End of extradata block
|
#define DW_END 0xFF // End of extradata block
|
||||||
#define DW_RNG 0xFE // Check RNG seed!
|
#define DW_RNG 0xFE // Check RNG seed!
|
||||||
|
|
||||||
|
|
@ -163,7 +154,7 @@ static ticcmd_t oldcmd[MAXPLAYERS];
|
||||||
// Below consts are only used for demo extrainfo sections
|
// Below consts are only used for demo extrainfo sections
|
||||||
#define DW_STANDING 0x00
|
#define DW_STANDING 0x00
|
||||||
|
|
||||||
// For Metal Sonic and time attack ghosts
|
// For time attack ghosts
|
||||||
#define GZT_XYZ 0x01
|
#define GZT_XYZ 0x01
|
||||||
#define GZT_MOMXY 0x02
|
#define GZT_MOMXY 0x02
|
||||||
#define GZT_MOMZ 0x04
|
#define GZT_MOMZ 0x04
|
||||||
|
|
@ -190,22 +181,7 @@ static ticcmd_t oldcmd[MAXPLAYERS];
|
||||||
#define FZT_SCALE 0x10 // different scale to object
|
#define FZT_SCALE 0x10 // different scale to object
|
||||||
// spare FZT slots 0x20 to 0x80
|
// spare FZT slots 0x20 to 0x80
|
||||||
|
|
||||||
static mobj_t oldmetal, oldghost[MAXPLAYERS];
|
static mobj_t oldghost[MAXPLAYERS];
|
||||||
|
|
||||||
void G_SaveMetal(UINT8 **buffer)
|
|
||||||
{
|
|
||||||
I_Assert(buffer != NULL && *buffer != NULL);
|
|
||||||
|
|
||||||
WRITEUINT32(*buffer, metal_p - metalbuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void G_LoadMetal(UINT8 **buffer)
|
|
||||||
{
|
|
||||||
I_Assert(buffer != NULL && *buffer != NULL);
|
|
||||||
|
|
||||||
G_DoPlayMetal();
|
|
||||||
metal_p = metalbuffer + READUINT32(*buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void G_ReadDemoExtraData(void)
|
void G_ReadDemoExtraData(void)
|
||||||
{
|
{
|
||||||
|
|
@ -690,7 +666,7 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
||||||
|
|
||||||
void G_GhostAddFlip(INT32 playernum)
|
void G_GhostAddFlip(INT32 playernum)
|
||||||
{
|
{
|
||||||
if (!metalrecording && (!demo.recording || !(demoflags & DF_GHOST)))
|
if ((!demo.recording || !(demoflags & DF_GHOST)))
|
||||||
return;
|
return;
|
||||||
ghostext[playernum].flags |= EZT_FLIP;
|
ghostext[playernum].flags |= EZT_FLIP;
|
||||||
}
|
}
|
||||||
|
|
@ -710,7 +686,7 @@ void G_GhostAddColor(INT32 playernum, ghostcolor_t color)
|
||||||
|
|
||||||
void G_GhostAddScale(INT32 playernum, fixed_t scale)
|
void G_GhostAddScale(INT32 playernum, fixed_t scale)
|
||||||
{
|
{
|
||||||
if (!metalrecording && (!demo.recording || !(demoflags & DF_GHOST)))
|
if ((!demo.recording || !(demoflags & DF_GHOST)))
|
||||||
return;
|
return;
|
||||||
if (ghostext[playernum].lastscale == scale)
|
if (ghostext[playernum].lastscale == scale)
|
||||||
{
|
{
|
||||||
|
|
@ -1752,336 +1728,6 @@ void G_ConfirmRewind(tic_t rewindtime)
|
||||||
P_ResetCamera(&players[displayplayers[i]], &camera[i]);
|
P_ResetCamera(&players[displayplayers[i]], &camera[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_ReadMetalTic(mobj_t *metal)
|
|
||||||
{
|
|
||||||
UINT8 ziptic;
|
|
||||||
UINT8 xziptic = 0;
|
|
||||||
|
|
||||||
if (!metal_p)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!metal->health)
|
|
||||||
{
|
|
||||||
G_StopMetalDemo();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (*metal_p)
|
|
||||||
{
|
|
||||||
case METALSNICE:
|
|
||||||
break;
|
|
||||||
case METALDEATH:
|
|
||||||
if (metal->tracer)
|
|
||||||
P_RemoveMobj(metal->tracer);
|
|
||||||
P_KillMobj(metal, NULL, NULL, DMG_NORMAL);
|
|
||||||
/* FALLTHRU */
|
|
||||||
case DEMOMARKER:
|
|
||||||
default:
|
|
||||||
// end of demo data stream
|
|
||||||
G_StopMetalDemo();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
metal_p++;
|
|
||||||
|
|
||||||
ziptic = READUINT8(metal_p);
|
|
||||||
|
|
||||||
// Read changes from the tic
|
|
||||||
if (ziptic & GZT_XYZ)
|
|
||||||
{
|
|
||||||
// make sure the values are read in the right order
|
|
||||||
oldmetal.x = READFIXED(metal_p);
|
|
||||||
oldmetal.y = READFIXED(metal_p);
|
|
||||||
oldmetal.z = READFIXED(metal_p);
|
|
||||||
P_MoveOrigin(metal, oldmetal.x, oldmetal.y, oldmetal.z);
|
|
||||||
oldmetal.x = metal->x;
|
|
||||||
oldmetal.y = metal->y;
|
|
||||||
oldmetal.z = metal->z;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ziptic & GZT_MOMXY)
|
|
||||||
{
|
|
||||||
oldmetal.momx = (metalversion < 0x000e) ? READINT16(metal_p)<<8 : READFIXED(metal_p);
|
|
||||||
oldmetal.momy = (metalversion < 0x000e) ? READINT16(metal_p)<<8 : READFIXED(metal_p);
|
|
||||||
}
|
|
||||||
if (ziptic & GZT_MOMZ)
|
|
||||||
oldmetal.momz = (metalversion < 0x000e) ? READINT16(metal_p)<<8 : READFIXED(metal_p);
|
|
||||||
oldmetal.x += oldmetal.momx;
|
|
||||||
oldmetal.y += oldmetal.momy;
|
|
||||||
oldmetal.z += oldmetal.momz;
|
|
||||||
}
|
|
||||||
if (ziptic & GZT_ANGLE)
|
|
||||||
metal->angle = READUINT8(metal_p)<<24;
|
|
||||||
if (ziptic & GZT_FRAME)
|
|
||||||
oldmetal.frame = READUINT32(metal_p);
|
|
||||||
if (ziptic & GZT_SPR2)
|
|
||||||
oldmetal.sprite2 = READUINT8(metal_p);
|
|
||||||
|
|
||||||
// Set movement, position, and angle
|
|
||||||
// oldmetal contains where you're supposed to be.
|
|
||||||
metal->momx = oldmetal.momx;
|
|
||||||
metal->momy = oldmetal.momy;
|
|
||||||
metal->momz = oldmetal.momz;
|
|
||||||
P_UnsetThingPosition(metal);
|
|
||||||
metal->x = oldmetal.x;
|
|
||||||
metal->y = oldmetal.y;
|
|
||||||
metal->z = oldmetal.z;
|
|
||||||
P_SetThingPosition(metal);
|
|
||||||
metal->frame = oldmetal.frame;
|
|
||||||
metal->sprite2 = oldmetal.sprite2;
|
|
||||||
|
|
||||||
if (ziptic & GZT_EXTRA)
|
|
||||||
{ // But wait, there's more!
|
|
||||||
xziptic = READUINT8(metal_p);
|
|
||||||
if (xziptic & EZT_FLIP)
|
|
||||||
{
|
|
||||||
metal->eflags ^= MFE_VERTICALFLIP;
|
|
||||||
metal->flags2 ^= MF2_OBJECTFLIP;
|
|
||||||
}
|
|
||||||
if (xziptic & EZT_SCALE)
|
|
||||||
{
|
|
||||||
metal->destscale = READFIXED(metal_p);
|
|
||||||
if (metal->destscale != metal->scale)
|
|
||||||
P_SetScale(metal, metal->destscale);
|
|
||||||
}
|
|
||||||
if (xziptic & EZT_SPRITE)
|
|
||||||
metal->sprite = READUINT16(metal_p);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define follow metal->tracer
|
|
||||||
if (ziptic & GZT_FOLLOW)
|
|
||||||
{ // Even more...
|
|
||||||
UINT8 followtic = READUINT8(metal_p);
|
|
||||||
fixed_t temp;
|
|
||||||
if (followtic & FZT_SPAWNED)
|
|
||||||
{
|
|
||||||
if (follow)
|
|
||||||
P_RemoveMobj(follow);
|
|
||||||
P_SetTarget(&follow, P_SpawnMobjFromMobj(metal, 0, 0, 0, MT_GHOST));
|
|
||||||
P_SetTarget(&follow->tracer, metal);
|
|
||||||
follow->tics = -1;
|
|
||||||
temp = READINT16(metal_p)<<FRACBITS;
|
|
||||||
follow->height = FixedMul(follow->scale, temp);
|
|
||||||
|
|
||||||
if (followtic & FZT_LINKDRAW)
|
|
||||||
follow->flags2 |= MF2_LINKDRAW;
|
|
||||||
|
|
||||||
if (followtic & FZT_COLORIZED)
|
|
||||||
follow->colorized = true;
|
|
||||||
|
|
||||||
if (followtic & FZT_SKIN)
|
|
||||||
follow->skin = &skins[READUINT8(metal_p)];
|
|
||||||
}
|
|
||||||
if (follow)
|
|
||||||
{
|
|
||||||
if (followtic & FZT_SCALE)
|
|
||||||
follow->destscale = READFIXED(metal_p);
|
|
||||||
else
|
|
||||||
follow->destscale = metal->destscale;
|
|
||||||
if (follow->destscale != follow->scale)
|
|
||||||
P_SetScale(follow, follow->destscale);
|
|
||||||
|
|
||||||
P_UnsetThingPosition(follow);
|
|
||||||
temp = (metalversion < 0x000e) ? READINT16(metal_p)<<8 : READFIXED(metal_p);
|
|
||||||
follow->x = metal->x + temp;
|
|
||||||
temp = (metalversion < 0x000e) ? READINT16(metal_p)<<8 : READFIXED(metal_p);
|
|
||||||
follow->y = metal->y + temp;
|
|
||||||
temp = (metalversion < 0x000e) ? READINT16(metal_p)<<8 : READFIXED(metal_p);
|
|
||||||
follow->z = metal->z + temp;
|
|
||||||
P_SetThingPosition(follow);
|
|
||||||
if (followtic & FZT_SKIN)
|
|
||||||
follow->sprite2 = READUINT8(metal_p);
|
|
||||||
else
|
|
||||||
follow->sprite2 = 0;
|
|
||||||
follow->sprite = READUINT16(metal_p);
|
|
||||||
follow->frame = READUINT32(metal_p); // NOT & FF_FRAMEMASK here, so 32 bits
|
|
||||||
follow->angle = metal->angle;
|
|
||||||
follow->color = READUINT16(metal_p);
|
|
||||||
|
|
||||||
if (!(followtic & FZT_SPAWNED))
|
|
||||||
{
|
|
||||||
if (xziptic & EZT_FLIP)
|
|
||||||
{
|
|
||||||
follow->flags2 ^= MF2_OBJECTFLIP;
|
|
||||||
follow->eflags ^= MFE_VERTICALFLIP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (follow)
|
|
||||||
{
|
|
||||||
P_RemoveMobj(follow);
|
|
||||||
P_SetTarget(&follow, NULL);
|
|
||||||
}
|
|
||||||
#undef follow
|
|
||||||
}
|
|
||||||
|
|
||||||
void G_WriteMetalTic(mobj_t *metal)
|
|
||||||
{
|
|
||||||
UINT8 ziptic = 0;
|
|
||||||
UINT8 *ziptic_p;
|
|
||||||
|
|
||||||
if (!demobuf.p) // demobuf.p will be NULL until the race start linedef executor is activated!
|
|
||||||
return;
|
|
||||||
|
|
||||||
WRITEUINT8(demobuf.p, METALSNICE);
|
|
||||||
ziptic_p = demobuf.p++; // the ziptic, written at the end of this function
|
|
||||||
|
|
||||||
#define MAXMOM (0xFFFF<<8)
|
|
||||||
|
|
||||||
// GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic.
|
|
||||||
if (abs(metal->x-oldmetal.x) > MAXMOM
|
|
||||||
|| abs(metal->y-oldmetal.y) > MAXMOM
|
|
||||||
|| abs(metal->z-oldmetal.z) > MAXMOM)
|
|
||||||
{
|
|
||||||
oldmetal.x = metal->x;
|
|
||||||
oldmetal.y = metal->y;
|
|
||||||
oldmetal.z = metal->z;
|
|
||||||
ziptic |= GZT_XYZ;
|
|
||||||
WRITEFIXED(demobuf.p,oldmetal.x);
|
|
||||||
WRITEFIXED(demobuf.p,oldmetal.y);
|
|
||||||
WRITEFIXED(demobuf.p,oldmetal.z);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// For moving normally:
|
|
||||||
// Store movement as a fixed value
|
|
||||||
fixed_t momx = metal->x-oldmetal.x;
|
|
||||||
fixed_t momy = metal->y-oldmetal.y;
|
|
||||||
if (momx != oldmetal.momx
|
|
||||||
|| momy != oldmetal.momy)
|
|
||||||
{
|
|
||||||
oldmetal.momx = momx;
|
|
||||||
oldmetal.momy = momy;
|
|
||||||
ziptic |= GZT_MOMXY;
|
|
||||||
WRITEFIXED(demobuf.p,momx);
|
|
||||||
WRITEFIXED(demobuf.p,momy);
|
|
||||||
}
|
|
||||||
momx = metal->z-oldmetal.z;
|
|
||||||
if (momx != oldmetal.momz)
|
|
||||||
{
|
|
||||||
oldmetal.momz = momx;
|
|
||||||
ziptic |= GZT_MOMZ;
|
|
||||||
WRITEFIXED(demobuf.p,momx);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This SHOULD set oldmetal.x/y/z to match metal->x/y/z
|
|
||||||
oldmetal.x += oldmetal.momx;
|
|
||||||
oldmetal.y += oldmetal.momy;
|
|
||||||
oldmetal.z += oldmetal.momz;
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef MAXMOM
|
|
||||||
|
|
||||||
// Only store the 8 most relevant bits of angle
|
|
||||||
// because exact values aren't too easy to discern to begin with when only 8 angles have different sprites
|
|
||||||
// and it does not affect movement at all anyway.
|
|
||||||
if (metal->player && metal->player->drawangle>>24 != oldmetal.angle)
|
|
||||||
{
|
|
||||||
oldmetal.angle = metal->player->drawangle>>24;
|
|
||||||
ziptic |= GZT_ANGLE;
|
|
||||||
WRITEUINT8(demobuf.p,oldmetal.angle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store the sprite frame.
|
|
||||||
if ((metal->frame & FF_FRAMEMASK) != oldmetal.frame)
|
|
||||||
{
|
|
||||||
oldmetal.frame = metal->frame; // NOT & FF_FRAMEMASK here, so 32 bits
|
|
||||||
ziptic |= GZT_FRAME;
|
|
||||||
WRITEUINT32(demobuf.p,oldmetal.frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (metal->sprite == SPR_PLAY
|
|
||||||
&& metal->sprite2 != oldmetal.sprite2)
|
|
||||||
{
|
|
||||||
oldmetal.sprite2 = metal->sprite2;
|
|
||||||
ziptic |= GZT_SPR2;
|
|
||||||
WRITEUINT8(demobuf.p,oldmetal.sprite2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for sprite set changes
|
|
||||||
if (metal->sprite != oldmetal.sprite)
|
|
||||||
{
|
|
||||||
oldmetal.sprite = metal->sprite;
|
|
||||||
ghostext[0].flags |= EZT_SPRITE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ghostext[0].flags & ~(EZT_COLOR|EZT_HIT)) // these two aren't handled by metal ever
|
|
||||||
{
|
|
||||||
ziptic |= GZT_EXTRA;
|
|
||||||
|
|
||||||
if (ghostext[0].scale == ghostext[0].lastscale)
|
|
||||||
ghostext[0].flags &= ~EZT_SCALE;
|
|
||||||
|
|
||||||
WRITEUINT8(demobuf.p,ghostext[0].flags);
|
|
||||||
if (ghostext[0].flags & EZT_SCALE)
|
|
||||||
{
|
|
||||||
WRITEFIXED(demobuf.p,ghostext[0].scale);
|
|
||||||
ghostext[0].lastscale = ghostext[0].scale;
|
|
||||||
}
|
|
||||||
if (ghostext[0].flags & EZT_SPRITE)
|
|
||||||
WRITEUINT16(demobuf.p,oldmetal.sprite);
|
|
||||||
ghostext[0].flags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (metal->player && metal->player->followmobj && !(metal->player->followmobj->sprite == SPR_NULL || (metal->player->followmobj->renderflags & RF_DONTDRAW) == RF_DONTDRAW))
|
|
||||||
{
|
|
||||||
fixed_t temp;
|
|
||||||
UINT8 *followtic_p = demobuf.p++;
|
|
||||||
UINT8 followtic = 0;
|
|
||||||
|
|
||||||
ziptic |= GZT_FOLLOW;
|
|
||||||
|
|
||||||
if (metal->player->followmobj->skin)
|
|
||||||
followtic |= FZT_SKIN;
|
|
||||||
|
|
||||||
if (!(oldmetal.flags2 & MF2_AMBUSH))
|
|
||||||
{
|
|
||||||
followtic |= FZT_SPAWNED;
|
|
||||||
WRITEINT16(demobuf.p,metal->player->followmobj->info->height>>FRACBITS);
|
|
||||||
if (metal->player->followmobj->flags2 & MF2_LINKDRAW)
|
|
||||||
followtic |= FZT_LINKDRAW;
|
|
||||||
if (metal->player->followmobj->colorized)
|
|
||||||
followtic |= FZT_COLORIZED;
|
|
||||||
if (followtic & FZT_SKIN)
|
|
||||||
WRITEUINT8(demobuf.p,(UINT8)(((skin_t *)(metal->player->followmobj->skin))-skins));
|
|
||||||
oldmetal.flags2 |= MF2_AMBUSH;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (metal->player->followmobj->scale != metal->scale)
|
|
||||||
{
|
|
||||||
followtic |= FZT_SCALE;
|
|
||||||
WRITEFIXED(demobuf.p,metal->player->followmobj->scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
temp = metal->player->followmobj->x-metal->x;
|
|
||||||
WRITEFIXED(demobuf.p,temp);
|
|
||||||
temp = metal->player->followmobj->y-metal->y;
|
|
||||||
WRITEFIXED(demobuf.p,temp);
|
|
||||||
temp = metal->player->followmobj->z-metal->z;
|
|
||||||
WRITEFIXED(demobuf.p,temp);
|
|
||||||
if (followtic & FZT_SKIN)
|
|
||||||
WRITEUINT8(demobuf.p,metal->player->followmobj->sprite2);
|
|
||||||
WRITEUINT16(demobuf.p,metal->player->followmobj->sprite);
|
|
||||||
WRITEUINT32(demobuf.p,metal->player->followmobj->frame); // NOT & FF_FRAMEMASK here, so 32 bits
|
|
||||||
WRITEUINT16(demobuf.p,metal->player->followmobj->color);
|
|
||||||
|
|
||||||
*followtic_p = followtic;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
oldmetal.flags2 &= ~MF2_AMBUSH;
|
|
||||||
|
|
||||||
*ziptic_p = ziptic;
|
|
||||||
|
|
||||||
// attention here for the ticcmd size!
|
|
||||||
// latest demos with mouse aiming byte in ticcmd
|
|
||||||
if (demobuf.p >= demobuf.end - 32)
|
|
||||||
{
|
|
||||||
G_StopMetalRecording(false); // no more space
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// G_RecordDemo
|
// G_RecordDemo
|
||||||
//
|
//
|
||||||
|
|
@ -2109,22 +1755,6 @@ void G_RecordDemo(const char *name)
|
||||||
demo.recording = true;
|
demo.recording = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_RecordMetal(void)
|
|
||||||
{
|
|
||||||
INT32 maxsize;
|
|
||||||
maxsize = 1024*1024;
|
|
||||||
if (M_CheckParm("-maxdemo") && M_IsNextParm())
|
|
||||||
maxsize = atoi(M_GetNextParm()) * 1024;
|
|
||||||
|
|
||||||
// FIXME: this file doesn't manage its memory and actually free this when it's done using it
|
|
||||||
Z_Free(demobuf.buffer);
|
|
||||||
P_SaveBufferAlloc(&demobuf, maxsize);
|
|
||||||
Z_SetUser(demobuf.buffer, (void**)&demobuf.buffer);
|
|
||||||
demobuf.p = NULL;
|
|
||||||
|
|
||||||
metalrecording = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void G_SaveDemoExtraFiles(UINT8 **pp)
|
static void G_SaveDemoExtraFiles(UINT8 **pp)
|
||||||
{
|
{
|
||||||
char *filename;
|
char *filename;
|
||||||
|
|
@ -2658,39 +2288,6 @@ void G_BeginRecording(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_BeginMetal(void)
|
|
||||||
{
|
|
||||||
mobj_t *mo = players[consoleplayer].mo;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (demobuf.p)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
demobuf.p = demobuf.buffer;
|
|
||||||
|
|
||||||
// Write header.
|
|
||||||
M_Memcpy(demobuf.p, DEMOHEADER, 12); demobuf.p += 12;
|
|
||||||
WRITEUINT8(demobuf.p,VERSION);
|
|
||||||
WRITEUINT8(demobuf.p,SUBVERSION);
|
|
||||||
WRITEUINT16(demobuf.p,DEMOVERSION);
|
|
||||||
|
|
||||||
// demo checksum
|
|
||||||
demobuf.p += 16;
|
|
||||||
|
|
||||||
M_Memcpy(demobuf.p, "METL", 4); demobuf.p += 4;
|
|
||||||
|
|
||||||
memset(&ghostext,0,sizeof(ghostext));
|
|
||||||
ghostext[0].lastscale = ghostext[0].scale = FRACUNIT;
|
|
||||||
|
|
||||||
// Set up our memory.
|
|
||||||
memset(&oldmetal,0,sizeof(oldmetal));
|
|
||||||
oldmetal.x = mo->x;
|
|
||||||
oldmetal.y = mo->y;
|
|
||||||
oldmetal.z = mo->z;
|
|
||||||
oldmetal.angle = mo->angle>>24;
|
|
||||||
}
|
|
||||||
|
|
||||||
void G_WriteStanding(UINT8 ranking, char *name, INT32 skinnum, UINT16 color, UINT32 val)
|
void G_WriteStanding(UINT8 ranking, char *name, INT32 skinnum, UINT16 color, UINT32 val)
|
||||||
{
|
{
|
||||||
char temp[16];
|
char temp[16];
|
||||||
|
|
@ -4025,72 +3622,6 @@ void G_TimeDemo(const char *name)
|
||||||
G_DeferedPlayDemo(name);
|
G_DeferedPlayDemo(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_DoPlayMetal(void)
|
|
||||||
{
|
|
||||||
lumpnum_t l;
|
|
||||||
mobj_t *mo = NULL;
|
|
||||||
thinker_t *th;
|
|
||||||
|
|
||||||
// it's an internal demo
|
|
||||||
// TODO: Use map header to determine lump name
|
|
||||||
if ((l = W_CheckNumForName(va("%sMS",G_BuildMapName(gamemap)))) == LUMPERROR)
|
|
||||||
{
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("No bot recording for this map.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
metalbuffer = metal_p = W_CacheLumpNum(l, PU_STATIC);
|
|
||||||
|
|
||||||
// find metal sonic
|
|
||||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
|
||||||
{
|
|
||||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
mo = (mobj_t *)th;
|
|
||||||
if (mo->type != MT_METALSONIC_RACE)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (th == &thlist[THINK_MOBJ])
|
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("Failed to find bot entity.\n"));
|
|
||||||
Z_Free(metalbuffer);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// read demo header
|
|
||||||
metal_p += 12; // DEMOHEADER
|
|
||||||
metal_p++; // VERSION
|
|
||||||
metal_p++; // SUBVERSION
|
|
||||||
metalversion = READUINT16(metal_p);
|
|
||||||
switch(metalversion)
|
|
||||||
{
|
|
||||||
case DEMOVERSION: // latest always supported
|
|
||||||
break;
|
|
||||||
// too old, cannot support.
|
|
||||||
default:
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, format version incompatible.\n"));
|
|
||||||
Z_Free(metalbuffer);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
metal_p += 16; // demo checksum
|
|
||||||
if (memcmp(metal_p, "METL", 4))
|
|
||||||
{
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Failed to load bot recording for this map, wasn't recorded in Metal format.\n"));
|
|
||||||
Z_Free(metalbuffer);
|
|
||||||
return;
|
|
||||||
} metal_p += 4; // "METL"
|
|
||||||
|
|
||||||
// read initial tic
|
|
||||||
memset(&oldmetal,0,sizeof(oldmetal));
|
|
||||||
oldmetal.x = mo->x;
|
|
||||||
oldmetal.y = mo->y;
|
|
||||||
oldmetal.z = mo->z;
|
|
||||||
metalplayback = mo;
|
|
||||||
}
|
|
||||||
|
|
||||||
void G_DoneLevelLoad(void)
|
void G_DoneLevelLoad(void)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("Loaded level in %f sec\n"), (double)(I_GetTime() - demostarttime) / TICRATE);
|
CONS_Printf(M_GetText("Loaded level in %f sec\n"), (double)(I_GetTime() - demostarttime) / TICRATE);
|
||||||
|
|
@ -4108,6 +3639,7 @@ void G_DoneLevelLoad(void)
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0 // since it's not actually used anymore, just a reference...
|
||||||
// Writes the demo's checksum, or just random garbage if you can't do that for some reason.
|
// Writes the demo's checksum, or just random garbage if you can't do that for some reason.
|
||||||
static void WriteDemoChecksum(void)
|
static void WriteDemoChecksum(void)
|
||||||
{
|
{
|
||||||
|
|
@ -4120,33 +3652,7 @@ static void WriteDemoChecksum(void)
|
||||||
md5_buffer((char *)p+16, demobuf.p - (p+16), p); // make a checksum of everything after the checksum in the file.
|
md5_buffer((char *)p+16, demobuf.p - (p+16), p); // make a checksum of everything after the checksum in the file.
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// Stops metal sonic's demo. Separate from other functions because metal + replays can coexist
|
|
||||||
void G_StopMetalDemo(void)
|
|
||||||
{
|
|
||||||
// Metal Sonic finishing doesn't end the game, dammit.
|
|
||||||
Z_Free(metalbuffer);
|
|
||||||
metalbuffer = NULL;
|
|
||||||
metalplayback = NULL;
|
|
||||||
metal_p = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stops metal sonic recording.
|
|
||||||
ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill)
|
|
||||||
{
|
|
||||||
boolean saved = false;
|
|
||||||
if (demobuf.p)
|
|
||||||
{
|
|
||||||
WRITEUINT8(demobuf.p, (kill) ? METALDEATH : DEMOMARKER); // add the demo end (or metal death) marker
|
|
||||||
WriteDemoChecksum();
|
|
||||||
saved = FIL_WriteFile(va("%sMS.LMP", G_BuildMapName(gamemap)), demobuf.buffer, demobuf.p - demobuf.buffer); // finally output the file.
|
|
||||||
}
|
|
||||||
Z_Free(demobuf.buffer);
|
|
||||||
metalrecording = false;
|
|
||||||
if (saved)
|
|
||||||
I_Error("Saved to %sMS.LMP", G_BuildMapName(gamemap));
|
|
||||||
I_Error("Failed to save demo!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stops timing a demo.
|
// Stops timing a demo.
|
||||||
static void G_StopTimingDemo(void)
|
static void G_StopTimingDemo(void)
|
||||||
|
|
@ -4246,8 +3752,6 @@ boolean G_CheckDemoStatus(void)
|
||||||
{
|
{
|
||||||
G_FreeGhosts();
|
G_FreeGhosts();
|
||||||
|
|
||||||
// DO NOT end metal sonic demos here
|
|
||||||
|
|
||||||
if (demo.timing)
|
if (demo.timing)
|
||||||
{
|
{
|
||||||
G_StopTimingDemo();
|
G_StopTimingDemo();
|
||||||
|
|
|
||||||
13
src/g_demo.h
13
src/g_demo.h
|
|
@ -97,13 +97,9 @@ struct menudemo_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern mobj_t *metalplayback;
|
|
||||||
|
|
||||||
// Only called by startup code.
|
// Only called by startup code.
|
||||||
void G_RecordDemo(const char *name);
|
void G_RecordDemo(const char *name);
|
||||||
void G_RecordMetal(void);
|
|
||||||
void G_BeginRecording(void);
|
void G_BeginRecording(void);
|
||||||
void G_BeginMetal(void);
|
|
||||||
|
|
||||||
// Only called by shutdown code.
|
// Only called by shutdown code.
|
||||||
void G_WriteStanding(UINT8 ranking, char *name, INT32 skinnum, UINT16 color, UINT32 val);
|
void G_WriteStanding(UINT8 ranking, char *name, INT32 skinnum, UINT16 color, UINT32 val);
|
||||||
|
|
@ -156,11 +152,6 @@ void G_StoreRewindInfo(void);
|
||||||
void G_PreviewRewind(tic_t previewtime);
|
void G_PreviewRewind(tic_t previewtime);
|
||||||
void G_ConfirmRewind(tic_t rewindtime);
|
void G_ConfirmRewind(tic_t rewindtime);
|
||||||
|
|
||||||
void G_ReadMetalTic(mobj_t *metal);
|
|
||||||
void G_WriteMetalTic(mobj_t *metal);
|
|
||||||
void G_SaveMetal(UINT8 **buffer);
|
|
||||||
void G_LoadMetal(UINT8 **buffer);
|
|
||||||
|
|
||||||
// Your naming conventions are stupid and useless.
|
// Your naming conventions are stupid and useless.
|
||||||
// There is no conflict here.
|
// There is no conflict here.
|
||||||
struct demoghost {
|
struct demoghost {
|
||||||
|
|
@ -193,10 +184,6 @@ staffbrief_t *G_GetStaffGhostBrief(UINT8 *buffer);
|
||||||
void G_FreeGhosts(void);
|
void G_FreeGhosts(void);
|
||||||
void G_DoneLevelLoad(void);
|
void G_DoneLevelLoad(void);
|
||||||
|
|
||||||
void G_DoPlayMetal(void);
|
|
||||||
void G_StopMetalDemo(void);
|
|
||||||
ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(boolean kill);
|
|
||||||
|
|
||||||
void G_StopDemo(void);
|
void G_StopDemo(void);
|
||||||
boolean G_CheckDemoStatus(void);
|
boolean G_CheckDemoStatus(void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3302,7 +3302,7 @@ void G_AddTOL(UINT32 newtol, const char *tolname)
|
||||||
//
|
//
|
||||||
boolean G_GametypeUsesLives(void)
|
boolean G_GametypeUsesLives(void)
|
||||||
{
|
{
|
||||||
if (modeattacking || metalrecording) // NOT in Record Attack
|
if (modeattacking) // NOT in Record Attack
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((grandprixinfo.gp == true) // In Grand Prix
|
if ((grandprixinfo.gp == true) // In Grand Prix
|
||||||
|
|
@ -4311,11 +4311,6 @@ static void G_DoCompleted(void)
|
||||||
|
|
||||||
gameaction = ga_nothing;
|
gameaction = ga_nothing;
|
||||||
|
|
||||||
if (metalplayback)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalRecording(false);
|
|
||||||
|
|
||||||
if (automapactive)
|
if (automapactive)
|
||||||
AM_Stop();
|
AM_Stop();
|
||||||
|
|
||||||
|
|
|
||||||
12398
src/info.c
12398
src/info.c
File diff suppressed because it is too large
Load diff
2786
src/info.h
2786
src/info.h
File diff suppressed because it is too large
Load diff
|
|
@ -757,7 +757,6 @@ static void OP_CycleThings(INT32 amt)
|
||||||
op_currentthing = 0;
|
op_currentthing = 0;
|
||||||
} while
|
} while
|
||||||
(mobjinfo[op_currentthing].doomednum == -1
|
(mobjinfo[op_currentthing].doomednum == -1
|
||||||
|| op_currentthing == MT_NIGHTSDRONE
|
|
||||||
|| mobjinfo[op_currentthing].flags & MF_NOSECTOR
|
|| mobjinfo[op_currentthing].flags & MF_NOSECTOR
|
||||||
|| (states[mobjinfo[op_currentthing].spawnstate].sprite == SPR_NULL
|
|| (states[mobjinfo[op_currentthing].spawnstate].sprite == SPR_NULL
|
||||||
&& states[mobjinfo[op_currentthing].seestate].sprite == SPR_NULL)
|
&& states[mobjinfo[op_currentthing].seestate].sprite == SPR_NULL)
|
||||||
|
|
|
||||||
|
|
@ -489,8 +489,6 @@ void M_StartTimeAttack(INT32 choice)
|
||||||
|
|
||||||
if (demo.playback)
|
if (demo.playback)
|
||||||
G_StopDemo();
|
G_StopDemo();
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
|
|
||||||
splitscreen = 0;
|
splitscreen = 0;
|
||||||
SplitScreen_OnChange();
|
SplitScreen_OnChange();
|
||||||
|
|
|
||||||
|
|
@ -709,8 +709,6 @@ void M_LevelSelected(INT16 add)
|
||||||
|
|
||||||
if (demo.playback)
|
if (demo.playback)
|
||||||
G_StopDemo();
|
G_StopDemo();
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
|
|
||||||
/*if (levellist.choosemap == 0)
|
/*if (levellist.choosemap == 0)
|
||||||
levellist.choosemap = G_RandMap(G_TOLFlag(levellist.newgametype), -1, 0, 0, false, NULL);*/
|
levellist.choosemap = G_RandMap(G_TOLFlag(levellist.newgametype), -1, 0, 0, false, NULL);*/
|
||||||
|
|
|
||||||
1229
src/p_enemy.c
1229
src/p_enemy.c
File diff suppressed because it is too large
Load diff
|
|
@ -980,16 +980,6 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
|
||||||
case MT_THOK:
|
case MT_THOK:
|
||||||
case MT_GHOST:
|
case MT_GHOST:
|
||||||
case MT_OVERLAY:
|
case MT_OVERLAY:
|
||||||
case MT_ELEMENTAL_ORB:
|
|
||||||
case MT_ATTRACT_ORB:
|
|
||||||
case MT_FORCE_ORB:
|
|
||||||
case MT_ARMAGEDDON_ORB:
|
|
||||||
case MT_WHIRLWIND_ORB:
|
|
||||||
case MT_PITY_ORB:
|
|
||||||
case MT_FLAMEAURA_ORB:
|
|
||||||
case MT_BUBBLEWRAP_ORB:
|
|
||||||
case MT_THUNDERCOIN_ORB:
|
|
||||||
case MT_IVSP:
|
|
||||||
case MT_SUPERSPARK:
|
case MT_SUPERSPARK:
|
||||||
case MT_RAIN:
|
case MT_RAIN:
|
||||||
case MT_SNOWFLAKE:
|
case MT_SNOWFLAKE:
|
||||||
|
|
@ -999,18 +989,11 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
|
||||||
case MT_SMOKE:
|
case MT_SMOKE:
|
||||||
case MT_SMALLBUBBLE:
|
case MT_SMALLBUBBLE:
|
||||||
case MT_MEDIUMBUBBLE:
|
case MT_MEDIUMBUBBLE:
|
||||||
case MT_TFOG:
|
|
||||||
case MT_SEED:
|
case MT_SEED:
|
||||||
case MT_PARTICLE:
|
case MT_PARTICLE:
|
||||||
case MT_SCORE:
|
|
||||||
case MT_DROWNNUMBERS:
|
case MT_DROWNNUMBERS:
|
||||||
case MT_GOTEMERALD:
|
|
||||||
case MT_LOCKON:
|
|
||||||
case MT_TAG:
|
|
||||||
case MT_GOTFLAG:
|
|
||||||
case MT_HOOP:
|
case MT_HOOP:
|
||||||
case MT_HOOPCOLLIDE:
|
case MT_HOOPCOLLIDE:
|
||||||
case MT_NIGHTSCORE:
|
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
162
src/p_inter.c
162
src/p_inter.c
|
|
@ -385,16 +385,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
// We now identify by object type, not sprite! Tails 04-11-2001
|
// We now identify by object type, not sprite! Tails 04-11-2001
|
||||||
switch (special->type)
|
switch (special->type)
|
||||||
{
|
{
|
||||||
case MT_MEMENTOSTP: // Mementos teleport
|
|
||||||
// Teleport player to the other teleporter (special->target). We'll assume there's always only ever 2.
|
|
||||||
if (!special->target)
|
|
||||||
return; // foolproof crash prevention check!!!!!
|
|
||||||
|
|
||||||
P_SetOrigin(player->mo, special->target->x, special->target->y, special->target->z + (48<<FRACBITS));
|
|
||||||
player->mo->angle = special->target->angle;
|
|
||||||
P_SetObjectMomZ(player->mo, 12<<FRACBITS, false);
|
|
||||||
P_InstaThrust(player->mo, player->mo->angle, 20<<FRACBITS);
|
|
||||||
return;
|
|
||||||
case MT_FLOATINGITEM: // SRB2Kart
|
case MT_FLOATINGITEM: // SRB2Kart
|
||||||
if (special->threshold >= FIRSTPOWERUP)
|
if (special->threshold >= FIRSTPOWERUP)
|
||||||
{
|
{
|
||||||
|
|
@ -903,11 +893,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
Obj_BungeeSpecial(special, player);
|
Obj_BungeeSpecial(special, player);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// CTF Flags
|
|
||||||
case MT_REDFLAG:
|
|
||||||
case MT_BLUEFLAG:
|
|
||||||
return;
|
|
||||||
|
|
||||||
case MT_CHEATCHECK:
|
case MT_CHEATCHECK:
|
||||||
P_TouchCheatcheck(special, player, special->thing_args[1]);
|
P_TouchCheatcheck(special, player, special->thing_args[1]);
|
||||||
return;
|
return;
|
||||||
|
|
@ -1615,8 +1600,6 @@ boolean P_CheckRacers(void)
|
||||||
*/
|
*/
|
||||||
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
|
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
mobj_t *mo;
|
|
||||||
|
|
||||||
if (target->flags & (MF_ENEMY|MF_BOSS))
|
if (target->flags & (MF_ENEMY|MF_BOSS))
|
||||||
target->momx = target->momy = target->momz = 0;
|
target->momx = target->momy = target->momz = 0;
|
||||||
|
|
||||||
|
|
@ -1705,9 +1688,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
|
// Let EVERYONE know what happened to a player! 01-29-2002 Tails
|
||||||
if (target->player && !target->player->spectator)
|
if (target->player && !target->player->spectator)
|
||||||
{
|
{
|
||||||
if (metalrecording) // Ack! Metal Sonic shouldn't die! Cut the tape, end recording!
|
|
||||||
G_StopMetalRecording(true);
|
|
||||||
|
|
||||||
target->renderflags &= ~RF_DONTDRAW;
|
target->renderflags &= ~RF_DONTDRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1787,150 +1767,16 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
// Other death animation effects
|
// Other death animation effects
|
||||||
switch(target->type)
|
switch(target->type)
|
||||||
{
|
{
|
||||||
case MT_BOUNCEPICKUP:
|
|
||||||
case MT_RAILPICKUP:
|
|
||||||
case MT_AUTOPICKUP:
|
|
||||||
case MT_EXPLODEPICKUP:
|
|
||||||
case MT_SCATTERPICKUP:
|
|
||||||
case MT_GRENADEPICKUP:
|
|
||||||
P_SetObjectMomZ(target, FRACUNIT, false);
|
|
||||||
target->fuse = target->info->damage;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_BUGGLE:
|
|
||||||
if (inflictor && inflictor->player // did a player kill you? Spawn relative to the player so they're bound to get it
|
|
||||||
&& P_AproxDistance(inflictor->x - target->x, inflictor->y - target->y) <= inflictor->radius + target->radius + FixedMul(8*FRACUNIT, inflictor->scale) // close enough?
|
|
||||||
&& inflictor->z <= target->z + target->height + FixedMul(8*FRACUNIT, inflictor->scale)
|
|
||||||
&& inflictor->z + inflictor->height >= target->z - FixedMul(8*FRACUNIT, inflictor->scale))
|
|
||||||
mo = P_SpawnMobj(inflictor->x + inflictor->momx, inflictor->y + inflictor->momy, inflictor->z + (inflictor->height / 2) + inflictor->momz, MT_EXTRALARGEBUBBLE);
|
|
||||||
else
|
|
||||||
mo = P_SpawnMobj(target->x, target->y, target->z, MT_EXTRALARGEBUBBLE);
|
|
||||||
mo->destscale = target->scale;
|
|
||||||
P_SetScale(mo, mo->destscale);
|
|
||||||
P_SetMobjState(mo, mo->info->raisestate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_YELLOWSHELL:
|
|
||||||
P_SpawnMobjFromMobj(target, 0, 0, 0, MT_YELLOWSPRING);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_CRAWLACOMMANDER:
|
|
||||||
target->momx = target->momy = target->momz = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_CRUSHSTACEAN:
|
|
||||||
if (target->tracer)
|
|
||||||
{
|
|
||||||
mobj_t *chain = target->tracer->target, *chainnext;
|
|
||||||
while (chain)
|
|
||||||
{
|
|
||||||
chainnext = chain->target;
|
|
||||||
P_RemoveMobj(chain);
|
|
||||||
chain = chainnext;
|
|
||||||
}
|
|
||||||
S_StopSound(target->tracer);
|
|
||||||
P_KillMobj(target->tracer, inflictor, source, damagetype);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_BANPYURA:
|
|
||||||
if (target->tracer)
|
|
||||||
{
|
|
||||||
S_StopSound(target->tracer);
|
|
||||||
P_KillMobj(target->tracer, inflictor, source, damagetype);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_EGGSHIELD:
|
|
||||||
P_SetObjectMomZ(target, 4*target->scale, false);
|
|
||||||
P_InstaThrust(target, target->angle, 3*target->scale);
|
|
||||||
target->flags = (target->flags|MF_NOCLIPHEIGHT) & ~MF_NOGRAVITY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_DRAGONBOMBER:
|
|
||||||
{
|
|
||||||
mobj_t *segment = target;
|
|
||||||
while (segment->tracer != NULL)
|
|
||||||
{
|
|
||||||
P_KillMobj(segment->tracer, NULL, NULL, DMG_NORMAL);
|
|
||||||
segment = segment->tracer;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MT_EGGMOBILE3:
|
|
||||||
{
|
|
||||||
mobj_t *mo2;
|
|
||||||
thinker_t *th;
|
|
||||||
UINT32 i = 0; // to check how many clones we've removed
|
|
||||||
|
|
||||||
// scan the thinkers to make sure all the old pinch dummies are gone on death
|
|
||||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
|
||||||
{
|
|
||||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
mo = (mobj_t *)th;
|
|
||||||
if (mo->type != (mobjtype_t)target->info->mass)
|
|
||||||
continue;
|
|
||||||
if (mo->tracer != target)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
P_KillMobj(mo, inflictor, source, damagetype);
|
|
||||||
mo->destscale = mo->scale/8;
|
|
||||||
mo->scalespeed = (mo->scale - mo->destscale)/(2*TICRATE);
|
|
||||||
mo->momz = mo->info->speed;
|
|
||||||
mo->angle = FixedAngle((P_RandomKey(PR_UNDEFINED, 36)*10)<<FRACBITS);
|
|
||||||
|
|
||||||
mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_BOSSJUNK);
|
|
||||||
mo2->angle = mo->angle;
|
|
||||||
P_SetMobjState(mo2, S_BOSSSEBH2);
|
|
||||||
|
|
||||||
if (++i == 2) // we've already removed 2 of these, let's stop now
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
S_StartSound(mo, mo->info->deathsound); // done once to prevent sound stacking
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_BIGMINE:
|
|
||||||
if (inflictor)
|
|
||||||
{
|
|
||||||
fixed_t dx = target->x - inflictor->x, dy = target->y - inflictor->y, dz = target->z - inflictor->z;
|
|
||||||
fixed_t dm = FixedHypot(dz, FixedHypot(dy, dx));
|
|
||||||
target->momx = FixedDiv(FixedDiv(dx, dm), dm)*512;
|
|
||||||
target->momy = FixedDiv(FixedDiv(dy, dm), dm)*512;
|
|
||||||
target->momz = FixedDiv(FixedDiv(dz, dm), dm)*512;
|
|
||||||
}
|
|
||||||
if (source)
|
|
||||||
P_SetTarget(&target->tracer, source);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_BLASTEXECUTOR:
|
case MT_BLASTEXECUTOR:
|
||||||
if (target->spawnpoint)
|
if (target->spawnpoint)
|
||||||
P_LinedefExecute(target->spawnpoint->angle, (source ? source : inflictor), target->subsector->sector);
|
P_LinedefExecute(target->spawnpoint->angle, (source ? source : inflictor), target->subsector->sector);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_SPINBOBERT:
|
|
||||||
if (target->hnext)
|
|
||||||
P_KillMobj(target->hnext, inflictor, source, damagetype);
|
|
||||||
if (target->hprev)
|
|
||||||
P_KillMobj(target->hprev, inflictor, source, damagetype);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_EGGTRAP:
|
case MT_EGGTRAP:
|
||||||
// Time for birdies! Yaaaaaaaay!
|
// Time for birdies! Yaaaaaaaay!
|
||||||
target->fuse = TICRATE;
|
target->fuse = TICRATE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_MINECART:
|
|
||||||
A_Scream(target);
|
|
||||||
target->momx = target->momy = target->momz = 0;
|
|
||||||
if (target->target && target->target->health)
|
|
||||||
P_KillMobj(target->target, target, source, DMG_NORMAL);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_PLAYER:
|
case MT_PLAYER:
|
||||||
if (damagetype != DMG_SPECTATOR)
|
if (damagetype != DMG_SPECTATOR)
|
||||||
{
|
{
|
||||||
|
|
@ -2018,13 +1864,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
target->tics = 175;
|
target->tics = 175;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MT_METALSONIC_RACE:
|
|
||||||
target->fuse = TICRATE*3;
|
|
||||||
target->momx = target->momy = target->momz = 0;
|
|
||||||
P_SetObjectMomZ(target, 14*FRACUNIT, false);
|
|
||||||
target->flags = (target->flags & ~MF_NOGRAVITY)|(MF_NOCLIP|MF_NOCLIPTHING);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// SRB2Kart:
|
// SRB2Kart:
|
||||||
case MT_SMK_ICEBLOCK:
|
case MT_SMK_ICEBLOCK:
|
||||||
{
|
{
|
||||||
|
|
@ -2871,7 +2710,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
}
|
}
|
||||||
|
|
||||||
// Everything above here can't be forced.
|
// Everything above here can't be forced.
|
||||||
if (!metalrecording)
|
|
||||||
{
|
{
|
||||||
UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage, damagetype);
|
UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage, damagetype);
|
||||||
if (P_MobjWasRemoved(target))
|
if (P_MobjWasRemoved(target))
|
||||||
|
|
|
||||||
|
|
@ -184,8 +184,6 @@ INT32 P_GivePlayerRings(player_t *player, INT32 num_rings);
|
||||||
INT32 P_GivePlayerSpheres(player_t *player, INT32 num_spheres);
|
INT32 P_GivePlayerSpheres(player_t *player, INT32 num_spheres);
|
||||||
void P_GivePlayerLives(player_t *player, INT32 numlives);
|
void P_GivePlayerLives(player_t *player, INT32 numlives);
|
||||||
UINT8 P_GetNextEmerald(void);
|
UINT8 P_GetNextEmerald(void);
|
||||||
void P_GiveEmerald(boolean spawnObj);
|
|
||||||
void P_GiveFinishFlags(player_t *player);
|
|
||||||
boolean P_AutoPause(void);
|
boolean P_AutoPause(void);
|
||||||
|
|
||||||
void P_ElementalFire(player_t *player, boolean cropcircle);
|
void P_ElementalFire(player_t *player, boolean cropcircle);
|
||||||
|
|
|
||||||
69
src/p_map.c
69
src/p_map.c
|
|
@ -486,18 +486,6 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
|
||||||
|
|
||||||
switch (spring->type)
|
switch (spring->type)
|
||||||
{
|
{
|
||||||
case MT_FAN: // fan
|
|
||||||
if (zdist > (spring->health << FRACBITS)) // max z distance determined by health (set by map thing args[0])
|
|
||||||
break;
|
|
||||||
if (flipval*object->momz >= FixedMul(speed, spring->scale)) // if object's already moving faster than your best, don't bother
|
|
||||||
break;
|
|
||||||
|
|
||||||
object->momz += flipval*FixedMul(speed/4, spring->scale);
|
|
||||||
|
|
||||||
// limit the speed if too high
|
|
||||||
if (flipval*object->momz > FixedMul(speed, spring->scale))
|
|
||||||
object->momz = flipval*FixedMul(speed, spring->scale);
|
|
||||||
break;
|
|
||||||
case MT_STEAM: // Steam
|
case MT_STEAM: // Steam
|
||||||
if (zdist > FixedMul(16*FRACUNIT, spring->scale))
|
if (zdist > FixedMul(16*FRACUNIT, spring->scale))
|
||||||
break;
|
break;
|
||||||
|
|
@ -1207,25 +1195,6 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
return BMIT_CONTINUE;
|
return BMIT_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((thing->type == MT_SPRINGSHELL || thing->type == MT_YELLOWSHELL) && thing->health > 0
|
|
||||||
&& (tm.thing->player || (tm.thing->flags & MF_PUSHABLE)) && tm.thing->health > 0)
|
|
||||||
{
|
|
||||||
// Multiplying by -1 inherently flips "less than" and "greater than"
|
|
||||||
fixed_t tmz = ((thing->eflags & MFE_VERTICALFLIP) ? -(tm.thing->z + tm.thing->height) : tm.thing->z);
|
|
||||||
fixed_t tmznext = ((thing->eflags & MFE_VERTICALFLIP) ? -tm.thing->momz : tm.thing->momz) + tmz;
|
|
||||||
fixed_t thzh = ((thing->eflags & MFE_VERTICALFLIP) ? -thing->z : thing->z + thing->height);
|
|
||||||
//fixed_t sprarea = FixedMul(8*FRACUNIT, thing->scale) * P_MobjFlip(thing);
|
|
||||||
|
|
||||||
//if ((tmznext <= thzh && tmz > thzh) || (tmznext > thzh - sprarea && tmznext < thzh))
|
|
||||||
if (tmznext <= thzh)
|
|
||||||
{
|
|
||||||
P_DoSpring(thing, tm.thing);
|
|
||||||
// return BMIT_CONTINUE;
|
|
||||||
}
|
|
||||||
//else if (tmz > thzh - sprarea && tmz < thzh) // Don't damage people springing up / down
|
|
||||||
return BMIT_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// missiles can hit other things
|
// missiles can hit other things
|
||||||
if ((tm.thing->flags & MF_MISSILE) && !damage) // if something was already damaged, don't run this
|
if ((tm.thing->flags & MF_MISSILE) && !damage) // if something was already damaged, don't run this
|
||||||
{
|
{
|
||||||
|
|
@ -1402,13 +1371,13 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
if (thing->flags & MF_PUSHABLE)
|
if (thing->flags & MF_PUSHABLE)
|
||||||
{
|
{
|
||||||
if (tm.thing->type == MT_FAN || tm.thing->type == MT_STEAM)
|
if (tm.thing->type == MT_STEAM)
|
||||||
P_DoFanAndGasJet(tm.thing, thing);
|
P_DoFanAndGasJet(tm.thing, thing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tm.thing->flags & MF_PUSHABLE)
|
if (tm.thing->flags & MF_PUSHABLE)
|
||||||
{
|
{
|
||||||
if (thing->type == MT_FAN || thing->type == MT_STEAM)
|
if (thing->type == MT_STEAM)
|
||||||
{
|
{
|
||||||
P_DoFanAndGasJet(thing, tm.thing);
|
P_DoFanAndGasJet(thing, tm.thing);
|
||||||
return BMIT_CONTINUE;
|
return BMIT_CONTINUE;
|
||||||
|
|
@ -1433,7 +1402,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
if (thing->player)
|
if (thing->player)
|
||||||
{
|
{
|
||||||
if (tm.thing->type == MT_FAN || tm.thing->type == MT_STEAM)
|
if (tm.thing->type == MT_STEAM)
|
||||||
P_DoFanAndGasJet(tm.thing, thing);
|
P_DoFanAndGasJet(tm.thing, thing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1442,7 +1411,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
if (!tm.thing->health)
|
if (!tm.thing->health)
|
||||||
return BMIT_CONTINUE;
|
return BMIT_CONTINUE;
|
||||||
|
|
||||||
if (thing->type == MT_FAN || thing->type == MT_STEAM)
|
if (thing->type == MT_STEAM)
|
||||||
P_DoFanAndGasJet(thing, tm.thing);
|
P_DoFanAndGasJet(thing, tm.thing);
|
||||||
else if (thing->flags & MF_SPRING)
|
else if (thing->flags & MF_SPRING)
|
||||||
{
|
{
|
||||||
|
|
@ -2235,8 +2204,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re
|
||||||
|
|
||||||
if (P_CheckSolidFFloorSurface(thing, rover))
|
if (P_CheckSolidFFloorSurface(thing, rover))
|
||||||
;
|
;
|
||||||
else if (thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE))
|
|
||||||
;
|
|
||||||
else if (!((rover->fofflags & FOF_BLOCKPLAYER && thing->player)
|
else if (!((rover->fofflags & FOF_BLOCKPLAYER && thing->player)
|
||||||
|| (rover->fofflags & FOF_BLOCKOTHERS && !thing->player)
|
|| (rover->fofflags & FOF_BLOCKOTHERS && !thing->player)
|
||||||
|| rover->fofflags & FOF_QUICKSAND))
|
|| rover->fofflags & FOF_QUICKSAND))
|
||||||
|
|
@ -2273,8 +2240,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bottomheight < tm.ceilingz && abs(delta1) >= abs(delta2)
|
if (bottomheight < tm.ceilingz && abs(delta1) >= abs(delta2)
|
||||||
&& !(rover->fofflags & FOF_PLATFORM)
|
&& !(rover->fofflags & FOF_PLATFORM))
|
||||||
&& !(thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE)))
|
|
||||||
{
|
{
|
||||||
tm.ceilingz = tm.drpoffceilz = bottomheight;
|
tm.ceilingz = tm.drpoffceilz = bottomheight;
|
||||||
tm.ceilingrover = rover;
|
tm.ceilingrover = rover;
|
||||||
|
|
@ -3039,7 +3005,7 @@ increment_move
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allowdropoff && !(thing->flags & MF_FLOAT) && thing->type != MT_SKIM && !tm.floorthing)
|
if (!allowdropoff && !(thing->flags & MF_FLOAT) && !tm.floorthing)
|
||||||
{
|
{
|
||||||
if (thing->eflags & MFE_VERTICALFLIP)
|
if (thing->eflags & MFE_VERTICALFLIP)
|
||||||
{
|
{
|
||||||
|
|
@ -4202,27 +4168,8 @@ void P_BounceMove(mobj_t *mo, TryMoveResult_t *result)
|
||||||
if (bestslideline == NULL)
|
if (bestslideline == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mo->type == MT_SHELL)
|
tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
||||||
{
|
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
||||||
tmxmove = mmomx;
|
|
||||||
tmymove = mmomy;
|
|
||||||
}
|
|
||||||
else if (mo->type == MT_THROWNBOUNCE)
|
|
||||||
{
|
|
||||||
tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>6) - (FRACUNIT>>5)));
|
|
||||||
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>6) - (FRACUNIT>>5)));
|
|
||||||
}
|
|
||||||
else if (mo->type == MT_THROWNGRENADE)
|
|
||||||
{
|
|
||||||
// Quickly decay speed as it bounces
|
|
||||||
tmxmove = FixedDiv(mmomx, 2*FRACUNIT);
|
|
||||||
tmymove = FixedDiv(mmomy, 2*FRACUNIT);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
|
||||||
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
|
||||||
}
|
|
||||||
|
|
||||||
P_HitBounceLine(bestslideline); // clip the moves
|
P_HitBounceLine(bestslideline); // clip the moves
|
||||||
|
|
||||||
|
|
|
||||||
555
src/p_mobj.c
555
src/p_mobj.c
|
|
@ -1201,24 +1201,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
switch (mo->type)
|
switch (mo->type)
|
||||||
{
|
{
|
||||||
case MT_FLINGRING:
|
case MT_FLINGRING:
|
||||||
case MT_FLINGCOIN:
|
|
||||||
case MT_FLINGBLUESPHERE:
|
case MT_FLINGBLUESPHERE:
|
||||||
case MT_FLINGNIGHTSCHIP:
|
|
||||||
case MT_BOUNCERING:
|
|
||||||
case MT_RAILRING:
|
|
||||||
case MT_INFINITYRING:
|
|
||||||
case MT_AUTOMATICRING:
|
|
||||||
case MT_EXPLOSIONRING:
|
|
||||||
case MT_SCATTERRING:
|
|
||||||
case MT_GRENADERING:
|
|
||||||
case MT_BOUNCEPICKUP:
|
|
||||||
case MT_RAILPICKUP:
|
|
||||||
case MT_AUTOPICKUP:
|
|
||||||
case MT_EXPLODEPICKUP:
|
|
||||||
case MT_SCATTERPICKUP:
|
|
||||||
case MT_GRENADEPICKUP:
|
|
||||||
case MT_REDFLAG:
|
|
||||||
case MT_BLUEFLAG:
|
|
||||||
if (mo->target)
|
if (mo->target)
|
||||||
{
|
{
|
||||||
// Flung items copy the gravity of their tosser.
|
// Flung items copy the gravity of their tosser.
|
||||||
|
|
@ -1314,12 +1297,6 @@ void P_CheckGravity(mobj_t *mo, boolean affect)
|
||||||
|
|
||||||
if (affect)
|
if (affect)
|
||||||
mo->momz += gravityadd;
|
mo->momz += gravityadd;
|
||||||
|
|
||||||
if (mo->type == MT_SKIM && mo->z + mo->momz <= mo->watertop && mo->z >= mo->watertop)
|
|
||||||
{
|
|
||||||
mo->momz = 0;
|
|
||||||
mo->flags |= MF_NOGRAVITY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1601,8 +1578,7 @@ void P_XYMovement(mobj_t *mo)
|
||||||
mo->momx = mo->momy = mo->momz = 0;
|
mo->momx = mo->momy = mo->momz = 0;
|
||||||
|
|
||||||
// set in 'search new direction' state?
|
// set in 'search new direction' state?
|
||||||
if (mo->type != MT_EGGMOBILE)
|
P_SetMobjState(mo, mo->info->spawnstate);
|
||||||
P_SetMobjState(mo, mo->info->spawnstate);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1936,7 +1912,7 @@ void P_XYMovement(mobj_t *mo)
|
||||||
if (mo->flags & MF_NOCLIPHEIGHT)
|
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||||
return; // no frictions for objects that can pass through floors
|
return; // no frictions for objects that can pass through floors
|
||||||
|
|
||||||
if (mo->flags & MF_MISSILE || mo->flags2 & MF2_SKULLFLY || mo->type == MT_SHELL || mo->type == MT_VULTURE || mo->type == MT_PENGUINATOR)
|
if (mo->flags & MF_MISSILE || mo->flags2 & MF2_SKULLFLY)
|
||||||
return; // no friction for missiles ever
|
return; // no friction for missiles ever
|
||||||
|
|
||||||
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
|
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
|
||||||
|
|
@ -2246,15 +2222,6 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
|
|
||||||
switch (mo->type)
|
switch (mo->type)
|
||||||
{
|
{
|
||||||
case MT_SKIM:
|
|
||||||
// skims don't bounce
|
|
||||||
if (mo->z > mo->watertop && mo->z - mo->momz <= mo->watertop)
|
|
||||||
{
|
|
||||||
mo->z = mo->watertop;
|
|
||||||
mo->momz = 0;
|
|
||||||
mo->flags |= MF_NOGRAVITY;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_SPINFIRE:
|
case MT_SPINFIRE:
|
||||||
if (P_CheckDeathPitCollide(mo))
|
if (P_CheckDeathPitCollide(mo))
|
||||||
{
|
{
|
||||||
|
|
@ -2262,43 +2229,9 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_GOOP:
|
|
||||||
if (P_CheckDeathPitCollide(mo))
|
|
||||||
{
|
|
||||||
P_RemoveMobj(mo);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (mo->z <= mo->floorz && mo->momz)
|
|
||||||
{
|
|
||||||
P_SetMobjState(mo, mo->info->meleestate);
|
|
||||||
mo->momx = mo->momy = mo->momz = 0;
|
|
||||||
mo->z = mo->floorz;
|
|
||||||
if (mo->info->painsound)
|
|
||||||
S_StartSound(mo, mo->info->painsound);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_FALLINGROCK:
|
case MT_FALLINGROCK:
|
||||||
case MT_BIGTUMBLEWEED:
|
case MT_BIGTUMBLEWEED:
|
||||||
case MT_LITTLETUMBLEWEED:
|
case MT_LITTLETUMBLEWEED:
|
||||||
case MT_SHELL:
|
|
||||||
// Remove stuff from death pits.
|
|
||||||
if (P_CheckDeathPitCollide(mo))
|
|
||||||
{
|
|
||||||
P_RemoveMobj(mo);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_REDFLAG:
|
|
||||||
case MT_BLUEFLAG:
|
|
||||||
// Remove from death pits. DON'T FUCKING DESPAWN IT DAMMIT
|
|
||||||
if (P_CheckDeathPitCollide(mo))
|
|
||||||
{
|
|
||||||
mo->fuse = 1;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MT_EMERALD:
|
case MT_EMERALD:
|
||||||
if (!(mo->flags & MF_NOCLIPHEIGHT) && P_CheckDeathPitCollide(mo))
|
if (!(mo->flags & MF_NOCLIPHEIGHT) && P_CheckDeathPitCollide(mo))
|
||||||
{
|
{
|
||||||
|
|
@ -2325,28 +2258,6 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
if (!(mo->momx || mo->momy || mo->momz))
|
if (!(mo->momx || mo->momy || mo->momz))
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case MT_BOUNCERING:
|
|
||||||
case MT_INFINITYRING:
|
|
||||||
case MT_AUTOMATICRING:
|
|
||||||
case MT_RAILRING:
|
|
||||||
case MT_EXPLOSIONRING:
|
|
||||||
case MT_SCATTERRING:
|
|
||||||
case MT_GRENADERING:
|
|
||||||
case MT_BOUNCEPICKUP:
|
|
||||||
case MT_RAILPICKUP:
|
|
||||||
case MT_AUTOPICKUP:
|
|
||||||
case MT_EXPLODEPICKUP:
|
|
||||||
case MT_SCATTERPICKUP:
|
|
||||||
case MT_GRENADEPICKUP:
|
|
||||||
// Remove flinged stuff from death pits.
|
|
||||||
if (P_CheckDeathPitCollide(mo) && (mo->flags2 & MF2_DONTRESPAWN))
|
|
||||||
{
|
|
||||||
P_RemoveMobj(mo);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!(mo->momx || mo->momy || mo->momz))
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
case MT_FLAMEJET:
|
case MT_FLAMEJET:
|
||||||
case MT_VERTICALFLAMEJET:
|
case MT_VERTICALFLAMEJET:
|
||||||
if (mo->flags & MF_SLIDEME)
|
if (mo->flags & MF_SLIDEME)
|
||||||
|
|
@ -2392,7 +2303,7 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
mo->momx = mo->momy = 0;
|
mo->momx = mo->momy = 0;
|
||||||
|
|
||||||
if (mo->flags & MF_FLOAT && mo->target && mo->health
|
if (mo->flags & MF_FLOAT && mo->target && mo->health
|
||||||
&& !(mo->type == MT_EGGMOBILE) && mo->target->health > 0)
|
&& mo->target->health > 0)
|
||||||
{
|
{
|
||||||
// float down towards target if too close
|
// float down towards target if too close
|
||||||
if (!(mo->flags2 & MF2_SKULLFLY) && !(mo->flags2 & MF2_INFLOAT))
|
if (!(mo->flags2 & MF2_SKULLFLY) && !(mo->flags2 & MF2_INFLOAT))
|
||||||
|
|
@ -2405,9 +2316,6 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
mo->z -= FixedMul(FLOATSPEED, mo->scale);
|
mo->z -= FixedMul(FLOATSPEED, mo->scale);
|
||||||
else if (delta > 0 && dist < (delta*3))
|
else if (delta > 0 && dist < (delta*3))
|
||||||
mo->z += FixedMul(FLOATSPEED, mo->scale);
|
mo->z += FixedMul(FLOATSPEED, mo->scale);
|
||||||
|
|
||||||
if (mo->type == MT_JETJAW && mo->z + mo->height > mo->watertop)
|
|
||||||
mo->z = mo->watertop - mo->height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2449,9 +2357,7 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// hit the floor
|
// hit the floor
|
||||||
if (mo->type == MT_FIREBALL) // special case for the fireball
|
if (mo->type == MT_SPINFIRE) // elemental shield fire is another exception here
|
||||||
mom.z = P_MobjFlip(mo)*FixedMul(5*FRACUNIT, mo->scale);
|
|
||||||
else if (mo->type == MT_SPINFIRE) // elemental shield fire is another exception here
|
|
||||||
;
|
;
|
||||||
else if (mo->type == MT_ITEM_DEBRIS)
|
else if (mo->type == MT_ITEM_DEBRIS)
|
||||||
{
|
{
|
||||||
|
|
@ -2740,12 +2646,6 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
{
|
{
|
||||||
if (mo->flags2 & MF2_SKULLFLY) // the skull slammed into something
|
if (mo->flags2 & MF2_SKULLFLY) // the skull slammed into something
|
||||||
mo->momz = -mo->momz;
|
mo->momz = -mo->momz;
|
||||||
else
|
|
||||||
// Flags bounce
|
|
||||||
if (mo->type == MT_REDFLAG || mo->type == MT_BLUEFLAG)
|
|
||||||
{
|
|
||||||
mo->momz = -FixedMul(mo->momz, FixedDiv(17*FRACUNIT,20*FRACUNIT));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
mo->momz = 0;
|
mo->momz = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -5821,12 +5721,8 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_BOSSJUNK:
|
|
||||||
mobj->renderflags ^= RF_DONTDRAW;
|
|
||||||
break;
|
|
||||||
case MT_MACEPOINT:
|
case MT_MACEPOINT:
|
||||||
case MT_CHAINMACEPOINT:
|
case MT_CHAINMACEPOINT:
|
||||||
case MT_SPRINGBALLPOINT:
|
|
||||||
case MT_CHAINPOINT:
|
case MT_CHAINPOINT:
|
||||||
case MT_FIREBARPOINT:
|
case MT_FIREBARPOINT:
|
||||||
case MT_CUSTOMMACEPOINT:
|
case MT_CUSTOMMACEPOINT:
|
||||||
|
|
@ -5859,29 +5755,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
else
|
else
|
||||||
mobj->fuse--;
|
mobj->fuse--;
|
||||||
return;
|
return;
|
||||||
case MT_NIGHTSPARKLE:
|
|
||||||
if (mobj->tics != -1)
|
|
||||||
{
|
|
||||||
mobj->tics--;
|
|
||||||
|
|
||||||
// you can cycle through multiple states in a tic
|
|
||||||
if (!mobj->tics)
|
|
||||||
if (!P_SetMobjState(mobj, mobj->state->nextstate))
|
|
||||||
return; // freed itself
|
|
||||||
}
|
|
||||||
|
|
||||||
P_UnsetThingPosition(mobj);
|
|
||||||
mobj->x += mobj->momx;
|
|
||||||
mobj->y += mobj->momy;
|
|
||||||
mobj->z += mobj->momz;
|
|
||||||
P_SetThingPosition(mobj);
|
|
||||||
return;
|
|
||||||
case MT_NIGHTSLOOPHELPER:
|
|
||||||
if (--mobj->tics <= 0)
|
|
||||||
P_RemoveMobj(mobj);
|
|
||||||
|
|
||||||
// Don't touch my fuse!
|
|
||||||
return;
|
|
||||||
case MT_OVERLAY:
|
case MT_OVERLAY:
|
||||||
if (!mobj->target)
|
if (!mobj->target)
|
||||||
{
|
{
|
||||||
|
|
@ -5951,45 +5824,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
P_RemoveMobj(mobj);
|
P_RemoveMobj(mobj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case MT_LOCKON:
|
|
||||||
if (!mobj->target)
|
|
||||||
{
|
|
||||||
P_RemoveMobj(mobj);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mobj->renderflags &= ~RF_DONTDRAW;
|
|
||||||
|
|
||||||
mobj->x = mobj->target->x;
|
|
||||||
mobj->y = mobj->target->y;
|
|
||||||
|
|
||||||
mobj->eflags |= (mobj->target->eflags & MFE_VERTICALFLIP);
|
|
||||||
|
|
||||||
mobj->destscale = mobj->target->destscale;
|
|
||||||
P_SetScale(mobj, mobj->target->scale);
|
|
||||||
|
|
||||||
if (!(mobj->eflags & MFE_VERTICALFLIP))
|
|
||||||
mobj->z = mobj->target->z + mobj->target->height + FixedMul((16 + abs((signed)(leveltime % TICRATE) - TICRATE/2))*FRACUNIT, mobj->target->scale);
|
|
||||||
else
|
|
||||||
mobj->z = mobj->target->z - FixedMul((16 + abs((signed)(leveltime % TICRATE) - TICRATE/2))*FRACUNIT, mobj->target->scale) - mobj->height;
|
|
||||||
|
|
||||||
mobj->old_z = mobj->z;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case MT_LOCKONINF:
|
|
||||||
if (!(mobj->flags2 & MF2_STRONGBOX))
|
|
||||||
{
|
|
||||||
mobj->threshold = mobj->z;
|
|
||||||
mobj->flags2 |= MF2_STRONGBOX;
|
|
||||||
}
|
|
||||||
if (!(mobj->eflags & MFE_VERTICALFLIP))
|
|
||||||
mobj->z = mobj->threshold + FixedMul((16 + abs((signed)(leveltime % TICRATE) - TICRATE/2))*FRACUNIT, mobj->scale);
|
|
||||||
else
|
|
||||||
mobj->z = mobj->threshold - FixedMul((16 + abs((signed)(leveltime % TICRATE) - TICRATE/2))*FRACUNIT, mobj->scale);
|
|
||||||
|
|
||||||
mobj->old_z = mobj->z;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case MT_FLAMEJET:
|
case MT_FLAMEJET:
|
||||||
P_FlameJetSceneryThink(mobj);
|
P_FlameJetSceneryThink(mobj);
|
||||||
|
|
@ -6047,7 +5881,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
case MT_ROCKCRUMBLE16:
|
case MT_ROCKCRUMBLE16:
|
||||||
case MT_WOODDEBRIS:
|
case MT_WOODDEBRIS:
|
||||||
case MT_BRICKDEBRIS:
|
case MT_BRICKDEBRIS:
|
||||||
case MT_BROKENROBOT:
|
|
||||||
if (mobj->z <= P_FloorzAtPos(mobj->x, mobj->y, mobj->z, mobj->height)
|
if (mobj->z <= P_FloorzAtPos(mobj->x, mobj->y, mobj->z, mobj->height)
|
||||||
&& mobj->state != &states[mobj->info->deathstate])
|
&& mobj->state != &states[mobj->info->deathstate])
|
||||||
{
|
{
|
||||||
|
|
@ -6059,10 +5892,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
if (!P_ParticleGenSceneryThink(mobj))
|
if (!P_ParticleGenSceneryThink(mobj))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case MT_FSGNA:
|
|
||||||
if (mobj->movedir)
|
|
||||||
mobj->angle += mobj->movedir;
|
|
||||||
break;
|
|
||||||
case MT_ORBINAUT_SHIELD: // Kart orbit/trail items
|
case MT_ORBINAUT_SHIELD: // Kart orbit/trail items
|
||||||
case MT_JAWZ_SHIELD:
|
case MT_JAWZ_SHIELD:
|
||||||
case MT_BANANA_SHIELD:
|
case MT_BANANA_SHIELD:
|
||||||
|
|
@ -6584,14 +6413,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_PETSMOKER:
|
|
||||||
if (!(leveltime % 10))
|
|
||||||
{
|
|
||||||
mobj_t *smok = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_PETSMOKE);
|
|
||||||
if (mobj->thing_args[0])
|
|
||||||
P_SetMobjStateNF(smok, smok->info->painstate); // same function, diff sprite
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_ITEMCAPSULE_PART:
|
case MT_ITEMCAPSULE_PART:
|
||||||
P_ItemCapsulePartThinker(mobj);
|
P_ItemCapsulePartThinker(mobj);
|
||||||
|
|
||||||
|
|
@ -6908,17 +6729,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
||||||
Obj_EMZRainGenerator(mobj);
|
Obj_EMZRainGenerator(mobj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case MT_VWREF:
|
|
||||||
case MT_VWREB:
|
|
||||||
{
|
|
||||||
INT32 strength;
|
|
||||||
++mobj->movedir;
|
|
||||||
mobj->frame &= ~FF_TRANSMASK;
|
|
||||||
strength = min(mobj->fuse, (INT32)mobj->movedir)*3;
|
|
||||||
if (strength < 10)
|
|
||||||
mobj->frame |= ((10 - strength) << (FF_TRANSSHIFT));
|
|
||||||
}
|
|
||||||
/* FALLTHRU */
|
|
||||||
default:
|
default:
|
||||||
if (mobj->fuse)
|
if (mobj->fuse)
|
||||||
{ // Scenery object fuse! Very basic!
|
{ // Scenery object fuse! Very basic!
|
||||||
|
|
@ -7014,21 +6824,6 @@ static boolean P_MobjDeadThink(mobj_t *mobj)
|
||||||
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
|
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_METALSONIC_RACE:
|
|
||||||
{
|
|
||||||
if (!(mobj->fuse % 8))
|
|
||||||
{
|
|
||||||
fixed_t r = mobj->radius >> FRACBITS;
|
|
||||||
mobj_t *explosion = P_SpawnMobj(
|
|
||||||
mobj->x + (P_RandomRange(PR_UNDEFINED, r, -r) << FRACBITS),
|
|
||||||
mobj->y + (P_RandomRange(PR_UNDEFINED, r, -r) << FRACBITS),
|
|
||||||
mobj->z + (P_RandomKey(PR_UNDEFINED, mobj->height >> FRACBITS) << FRACBITS),
|
|
||||||
MT_SONIC3KBOSSEXPLODE);
|
|
||||||
S_StartSound(explosion, sfx_s3kb4);
|
|
||||||
}
|
|
||||||
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_BANANA:
|
case MT_BANANA:
|
||||||
{
|
{
|
||||||
angle_t spin = FixedMul(FixedDiv(abs(mobj->momz), 8 * mobj->scale), ANGLE_67h);
|
angle_t spin = FixedMul(FixedDiv(abs(mobj->momz), 8 * mobj->scale), ANGLE_67h);
|
||||||
|
|
@ -10343,16 +10138,7 @@ static void P_FiringThink(mobj_t *mobj)
|
||||||
if (mobj->health <= 0)
|
if (mobj->health <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mobj->state->action.acp1 == (actionf_p1)A_Boss1Laser)
|
if (leveltime & 1) // Fire mode
|
||||||
{
|
|
||||||
if (mobj->state->tics > 1)
|
|
||||||
{
|
|
||||||
var1 = mobj->state->var1;
|
|
||||||
var2 = mobj->state->var2 & 65535;
|
|
||||||
mobj->state->action.acp1(mobj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (leveltime & 1) // Fire mode
|
|
||||||
{
|
{
|
||||||
mobj_t *missile;
|
mobj_t *missile;
|
||||||
|
|
||||||
|
|
@ -10387,9 +10173,6 @@ static boolean P_CanFlickerFuse(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
switch (mobj->type)
|
switch (mobj->type)
|
||||||
{
|
{
|
||||||
case MT_SNAPPER_HEAD:
|
|
||||||
case MT_SNAPPER_LEG:
|
|
||||||
case MT_MINECARTSEG:
|
|
||||||
case MT_MONITOR_PART:
|
case MT_MONITOR_PART:
|
||||||
case MT_BATTLEUFO:
|
case MT_BATTLEUFO:
|
||||||
case MT_BATTLEUFO_LEG:
|
case MT_BATTLEUFO_LEG:
|
||||||
|
|
@ -10853,9 +10636,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
|
|
||||||
// Sliding physics for slidey mobjs!
|
// Sliding physics for slidey mobjs!
|
||||||
if (mobj->type == MT_FLINGRING
|
if (mobj->type == MT_FLINGRING
|
||||||
|| mobj->type == MT_FLINGCOIN
|
|
||||||
|| mobj->type == MT_FLINGBLUESPHERE
|
|| mobj->type == MT_FLINGBLUESPHERE
|
||||||
|| mobj->type == MT_FLINGNIGHTSCHIP
|
|
||||||
|| mobj->type == MT_EMERALD
|
|| mobj->type == MT_EMERALD
|
||||||
|| mobj->type == MT_BIGTUMBLEWEED
|
|| mobj->type == MT_BIGTUMBLEWEED
|
||||||
|| mobj->type == MT_LITTLETUMBLEWEED
|
|| mobj->type == MT_LITTLETUMBLEWEED
|
||||||
|
|
@ -10883,8 +10664,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
if ((
|
if ((
|
||||||
(mobj->flags & (MF_ENEMY|MF_BOSS)
|
(mobj->flags & (MF_ENEMY|MF_BOSS)
|
||||||
&& mobj->flags & MF_SHOOTABLE)
|
&& mobj->flags & MF_SHOOTABLE))
|
||||||
|| mobj->type == MT_EGGSHIELD)
|
|
||||||
&& !(mobj->flags & MF_NOCLIPHEIGHT)
|
&& !(mobj->flags & MF_NOCLIPHEIGHT)
|
||||||
&& mobj->health > 0)
|
&& mobj->health > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -10901,35 +10681,6 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
P_CyclePlayerMobjState(mobj);
|
P_CyclePlayerMobjState(mobj);
|
||||||
else
|
else
|
||||||
P_CycleMobjState(mobj);
|
P_CycleMobjState(mobj);
|
||||||
|
|
||||||
if (P_MobjWasRemoved(mobj))
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (mobj->type)
|
|
||||||
{
|
|
||||||
case MT_BOUNCEPICKUP:
|
|
||||||
case MT_RAILPICKUP:
|
|
||||||
case MT_AUTOPICKUP:
|
|
||||||
case MT_EXPLODEPICKUP:
|
|
||||||
case MT_SCATTERPICKUP:
|
|
||||||
case MT_GRENADEPICKUP:
|
|
||||||
if (mobj->health == 0) // Fading tile
|
|
||||||
{
|
|
||||||
INT32 value = mobj->info->damage/10;
|
|
||||||
value = mobj->fuse/value;
|
|
||||||
value = 10-value;
|
|
||||||
value--;
|
|
||||||
|
|
||||||
if (value <= 0)
|
|
||||||
value = 1;
|
|
||||||
|
|
||||||
mobj->frame &= ~FF_TRANSMASK;
|
|
||||||
mobj->frame |= value << FF_TRANSSHIFT;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quick, optimized function for the Rail Rings
|
// Quick, optimized function for the Rail Rings
|
||||||
|
|
@ -11146,8 +10897,6 @@ static void P_DefaultMobjShadowScale(mobj_t *thing)
|
||||||
break;
|
break;
|
||||||
case MT_SMALLMACE:
|
case MT_SMALLMACE:
|
||||||
case MT_BIGMACE:
|
case MT_BIGMACE:
|
||||||
case MT_PUMA:
|
|
||||||
case MT_BIGPUMA:
|
|
||||||
case MT_FALLINGROCK:
|
case MT_FALLINGROCK:
|
||||||
case MT_SMK_MOLE:
|
case MT_SMK_MOLE:
|
||||||
case MT_SMK_THWOMP:
|
case MT_SMK_THWOMP:
|
||||||
|
|
@ -11219,9 +10968,6 @@ static void P_DefaultMobjShadowScale(mobj_t *thing)
|
||||||
case MT_AIRIVOBALL:
|
case MT_AIRIVOBALL:
|
||||||
thing->shadowscale = FRACUNIT/2;
|
thing->shadowscale = FRACUNIT/2;
|
||||||
break;
|
break;
|
||||||
case MT_BUMPER:
|
|
||||||
thing->shadowscale = 7*FRACUNIT/4;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if (thing->flags & (MF_ENEMY|MF_BOSS))
|
if (thing->flags & (MF_ENEMY|MF_BOSS))
|
||||||
thing->shadowscale = FRACUNIT;
|
thing->shadowscale = FRACUNIT;
|
||||||
|
|
@ -11334,9 +11080,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
{
|
{
|
||||||
mobj->z = mobj->floorz;
|
mobj->z = mobj->floorz;
|
||||||
|
|
||||||
if (mobj->type == MT_UNIDUS)
|
|
||||||
mobj->z += FixedMul(mobj->info->mass, mobj->scale);
|
|
||||||
|
|
||||||
// defaults onground
|
// defaults onground
|
||||||
if (mobj->z == mobj->floorz)
|
if (mobj->z == mobj->floorz)
|
||||||
mobj->eflags |= MFE_ONGROUND;
|
mobj->eflags |= MFE_ONGROUND;
|
||||||
|
|
@ -11345,9 +11088,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
{
|
{
|
||||||
mobj->z = mobj->ceilingz - mobj->height;
|
mobj->z = mobj->ceilingz - mobj->height;
|
||||||
|
|
||||||
if (mobj->type == MT_UNIDUS)
|
|
||||||
mobj->z -= FixedMul(mobj->info->mass, mobj->scale);
|
|
||||||
|
|
||||||
// defaults onground
|
// defaults onground
|
||||||
if (mobj->z + mobj->height == mobj->ceilingz)
|
if (mobj->z + mobj->height == mobj->ceilingz)
|
||||||
mobj->eflags |= MFE_ONGROUND;
|
mobj->eflags |= MFE_ONGROUND;
|
||||||
|
|
@ -11378,82 +11118,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
else
|
else
|
||||||
switch (mobj->type)
|
switch (mobj->type)
|
||||||
{
|
{
|
||||||
case MT_LOCKONINF:
|
|
||||||
P_SetScale(mobj, (mobj->destscale = 3*mobj->scale));
|
|
||||||
break;
|
|
||||||
case MT_FAKEMOBILE:
|
|
||||||
case MT_EGGSHIELD:
|
|
||||||
mobj->flags2 |= MF2_INVERTAIMABLE;
|
|
||||||
break;
|
|
||||||
case MT_DETON:
|
|
||||||
mobj->movedir = 0;
|
|
||||||
break;
|
|
||||||
case MT_EGGGUARD:
|
|
||||||
{
|
|
||||||
mobj_t *spawn = P_SpawnMobj(x, y, z, MT_EGGSHIELD);
|
|
||||||
spawn->destscale = mobj->scale;
|
|
||||||
P_SetScale(spawn, mobj->scale);
|
|
||||||
P_SetTarget(&mobj->tracer, spawn);
|
|
||||||
P_SetTarget(&spawn->target, mobj);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_UNIDUS:
|
|
||||||
{
|
|
||||||
INT32 i;
|
|
||||||
mobj_t *ball;
|
|
||||||
// Spawn "damage" number of "painchance" spikeball mobjs
|
|
||||||
// threshold is the distance they should keep from the MT_UNIDUS (touching radius + ball painchance)
|
|
||||||
for (i = 0; i < mobj->info->damage; i++)
|
|
||||||
{
|
|
||||||
ball = P_SpawnMobj(x, y, z, mobj->info->painchance);
|
|
||||||
ball->destscale = mobj->scale;
|
|
||||||
P_SetScale(ball, mobj->scale);
|
|
||||||
P_SetTarget(&ball->target, mobj);
|
|
||||||
ball->movedir = FixedAngle(FixedMul(FixedDiv(i<<FRACBITS, mobj->info->damage<<FRACBITS), 360<<FRACBITS));
|
|
||||||
ball->threshold = ball->radius + mobj->radius + FixedMul(ball->info->painchance, ball->scale);
|
|
||||||
|
|
||||||
var1 = ball->state->var1, var2 = ball->state->var2;
|
|
||||||
ball->state->action.acp1(ball);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_POINTY:
|
|
||||||
{
|
|
||||||
INT32 q;
|
|
||||||
mobj_t *ball, *lastball = mobj;
|
|
||||||
|
|
||||||
for (q = 0; q < mobj->info->painchance; q++)
|
|
||||||
{
|
|
||||||
ball = P_SpawnMobj(x, y, z, mobj->info->mass);
|
|
||||||
ball->destscale = mobj->scale;
|
|
||||||
P_SetScale(ball, mobj->scale);
|
|
||||||
P_SetTarget(&lastball->tracer, ball);
|
|
||||||
P_SetTarget(&ball->target, mobj);
|
|
||||||
lastball = ball;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_CRUSHSTACEAN:
|
|
||||||
{
|
|
||||||
mobj_t *bigmeatyclaw = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_CRUSHCLAW);
|
|
||||||
bigmeatyclaw->angle = mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270);
|
|
||||||
P_SetTarget(&mobj->tracer, bigmeatyclaw);
|
|
||||||
P_SetTarget(&bigmeatyclaw->tracer, mobj);
|
|
||||||
mobj->reactiontime >>= 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_BANPYURA:
|
|
||||||
{
|
|
||||||
mobj_t *bigmeatyclaw = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_BANPSPRING);
|
|
||||||
bigmeatyclaw->angle = mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270);
|
|
||||||
P_SetTarget(&mobj->tracer, bigmeatyclaw);
|
|
||||||
P_SetTarget(&bigmeatyclaw->tracer, mobj);
|
|
||||||
mobj->reactiontime >>= 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_BIGMINE:
|
|
||||||
mobj->extravalue1 = FixedHypot(mobj->x, mobj->y)>>FRACBITS;
|
|
||||||
break;
|
|
||||||
case MT_WAVINGFLAG1:
|
case MT_WAVINGFLAG1:
|
||||||
case MT_WAVINGFLAG2:
|
case MT_WAVINGFLAG2:
|
||||||
{
|
{
|
||||||
|
|
@ -11468,17 +11132,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_EGGMOBILE2:
|
|
||||||
// Special condition for the 2nd boss.
|
|
||||||
mobj->watertop = mobj->info->speed;
|
|
||||||
break;
|
|
||||||
case MT_EGGMOBILE3:
|
|
||||||
mobj->movefactor = -512*FRACUNIT;
|
|
||||||
mobj->flags2 |= MF2_CLASSICPUSH;
|
|
||||||
break;
|
|
||||||
case MT_EGGMOBILE4:
|
|
||||||
mobj->flags2 |= MF2_INVERTAIMABLE;
|
|
||||||
break;
|
|
||||||
case MT_FLICKY_08:
|
case MT_FLICKY_08:
|
||||||
mobj->color = (P_RandomChance(PR_UNDEFINED, FRACUNIT/2) ? SKINCOLOR_RED : SKINCOLOR_AQUAMARINE);
|
mobj->color = (P_RandomChance(PR_UNDEFINED, FRACUNIT/2) ? SKINCOLOR_RED : SKINCOLOR_AQUAMARINE);
|
||||||
break;
|
break;
|
||||||
|
|
@ -11504,73 +11157,27 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
case MT_KART_LEFTOVER:
|
case MT_KART_LEFTOVER:
|
||||||
mobj->color = SKINCOLOR_RED;
|
mobj->color = SKINCOLOR_RED;
|
||||||
break;
|
break;
|
||||||
case MT_EGGROBO1:
|
|
||||||
mobj->movecount = P_RandomKey(PR_DECORATION, 13);
|
|
||||||
mobj->color = FIRSTRAINBOWCOLOR + P_RandomKey(PR_DECORATION, FIRSTSUPERCOLOR - FIRSTRAINBOWCOLOR);
|
|
||||||
break;
|
|
||||||
case MT_HIVEELEMENTAL:
|
|
||||||
mobj->extravalue1 = 5;
|
|
||||||
break;
|
|
||||||
case MT_SMASHINGSPIKEBALL:
|
case MT_SMASHINGSPIKEBALL:
|
||||||
mobj->movecount = mobj->z;
|
mobj->movecount = mobj->z;
|
||||||
break;
|
break;
|
||||||
case MT_SPINBOBERT:
|
|
||||||
{
|
|
||||||
mobj_t *fire;
|
|
||||||
fire = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_SPINBOBERT_FIRE1);
|
|
||||||
P_SetTarget(&fire->target, mobj);
|
|
||||||
P_SetTarget(&mobj->hnext, fire);
|
|
||||||
fire = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_SPINBOBERT_FIRE2);
|
|
||||||
P_SetTarget(&fire->target, mobj);
|
|
||||||
P_SetTarget(&mobj->hprev, fire);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MT_REDRING: // Make MT_REDRING red by default
|
|
||||||
mobj->color = skincolor_redring;
|
|
||||||
break;
|
|
||||||
case MT_SMALLBUBBLE: // Bubbles eventually dissipate, in case they get caught somewhere.
|
case MT_SMALLBUBBLE: // Bubbles eventually dissipate, in case they get caught somewhere.
|
||||||
case MT_MEDIUMBUBBLE:
|
case MT_MEDIUMBUBBLE:
|
||||||
case MT_EXTRALARGEBUBBLE:
|
case MT_EXTRALARGEBUBBLE:
|
||||||
mobj->fuse += 30 * TICRATE;
|
mobj->fuse += 30 * TICRATE;
|
||||||
break;
|
break;
|
||||||
case MT_NIGHTSDRONE:
|
|
||||||
nummaprings = -1; // no perfect bonus, rings are free
|
|
||||||
break;
|
|
||||||
case MT_EGGCAPSULE:
|
case MT_EGGCAPSULE:
|
||||||
mobj->reactiontime = 0;
|
mobj->reactiontime = 0;
|
||||||
mobj->extravalue1 = mobj->cvmem =\
|
mobj->extravalue1 = mobj->cvmem =\
|
||||||
mobj->cusval = mobj->movecount =\
|
mobj->cusval = mobj->movecount =\
|
||||||
mobj->lastlook = mobj->extravalue2 = -1;
|
mobj->lastlook = mobj->extravalue2 = -1;
|
||||||
break;
|
break;
|
||||||
case MT_REDTEAMRING:
|
|
||||||
mobj->color = skincolor_redteam;
|
|
||||||
break;
|
|
||||||
case MT_BLUETEAMRING:
|
|
||||||
mobj->color = skincolor_blueteam;
|
|
||||||
break;
|
|
||||||
case MT_RING:
|
case MT_RING:
|
||||||
if (nummaprings >= 0)
|
if (nummaprings >= 0)
|
||||||
nummaprings++;
|
nummaprings++;
|
||||||
break;
|
break;
|
||||||
case MT_METALSONIC_RACE:
|
|
||||||
mobj->skin = &skins[5];
|
|
||||||
/* FALLTHRU */
|
|
||||||
case MT_METALSONIC_BATTLE:
|
|
||||||
mobj->color = skins[5].prefcolor;
|
|
||||||
sc = 5;
|
|
||||||
break;
|
|
||||||
case MT_FANG:
|
|
||||||
sc = 4;
|
|
||||||
break;
|
|
||||||
case MT_ROSY:
|
|
||||||
sc = 3;
|
|
||||||
break;
|
|
||||||
case MT_CORK:
|
case MT_CORK:
|
||||||
mobj->flags2 |= MF2_SUPERFIRE;
|
mobj->flags2 |= MF2_SUPERFIRE;
|
||||||
break;
|
break;
|
||||||
case MT_FBOMB:
|
|
||||||
mobj->flags2 |= MF2_EXPLOSION;
|
|
||||||
break;
|
|
||||||
case MT_OILLAMP:
|
case MT_OILLAMP:
|
||||||
{
|
{
|
||||||
mobj_t* overlay = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
|
mobj_t* overlay = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
|
||||||
|
|
@ -11582,22 +11189,12 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
mobj->momx = 1; //stack hack
|
mobj->momx = 1; //stack hack
|
||||||
mobj->flags2 |= MF2_INVERTAIMABLE;
|
mobj->flags2 |= MF2_INVERTAIMABLE;
|
||||||
break;
|
break;
|
||||||
case MT_MINECARTEND:
|
|
||||||
P_SetTarget(&mobj->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_MINECARTENDSOLID));
|
|
||||||
mobj->tracer->angle = mobj->angle + ANGLE_90;
|
|
||||||
break;
|
|
||||||
case MT_TORCHFLOWER:
|
case MT_TORCHFLOWER:
|
||||||
{
|
{
|
||||||
mobj_t *fire = P_SpawnMobjFromMobj(mobj, 0, 0, 46*FRACUNIT, MT_FLAME);
|
mobj_t *fire = P_SpawnMobjFromMobj(mobj, 0, 0, 46*FRACUNIT, MT_FLAME);
|
||||||
P_SetTarget(&mobj->target, fire);
|
P_SetTarget(&mobj->target, fire);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MT_PYREFLY:
|
|
||||||
mobj->extravalue1 = (FixedHypot(mobj->x, mobj->y)/FRACUNIT) % 360;
|
|
||||||
mobj->extravalue2 = 0;
|
|
||||||
mobj->fuse = 100;
|
|
||||||
break;
|
|
||||||
// SRB2Kart
|
|
||||||
case MT_ITEMCAPSULE:
|
case MT_ITEMCAPSULE:
|
||||||
{
|
{
|
||||||
// set default item & count
|
// set default item & count
|
||||||
|
|
@ -13119,8 +12716,7 @@ static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing)
|
||||||
if (mthing->type <= MAXPLAYERS) // Player starts
|
if (mthing->type <= MAXPLAYERS) // Player starts
|
||||||
{
|
{
|
||||||
// save spots for respawning in network games
|
// save spots for respawning in network games
|
||||||
if (!metalrecording)
|
playerstarts[mthing->type - 1] = mthing;
|
||||||
playerstarts[mthing->type - 1] = mthing;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (mthing->type == 33) // Match starts
|
else if (mthing->type == 33) // Match starts
|
||||||
|
|
@ -13153,12 +12749,6 @@ static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (metalrecording && mthing->type == mobjinfo[MT_METALSONIC_RACE].doomednum)
|
|
||||||
{
|
|
||||||
// If recording, you ARE Metal Sonic. Do not spawn it, do not save normal spawnpoints.
|
|
||||||
playerstarts[0] = mthing;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (mthing->type == 750 // Slope vertex point (formerly chaos spawn)
|
else if (mthing->type == 750 // Slope vertex point (formerly chaos spawn)
|
||||||
|| (mthing->type == FLOOR_SLOPE_THING || mthing->type == CEILING_SLOPE_THING) // Slope anchors
|
|| (mthing->type == FLOOR_SLOPE_THING || mthing->type == CEILING_SLOPE_THING) // Slope anchors
|
||||||
|| (mthing->type >= 600 && mthing->type <= 611) // Special placement patterns
|
|| (mthing->type >= 600 && mthing->type <= 611) // Special placement patterns
|
||||||
|
|
@ -13207,12 +12797,6 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metalrecording) // Metal Sonic can't use these things.
|
|
||||||
{
|
|
||||||
if (mobjinfo[i].flags & (MF_ENEMY|MF_BOSS))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -13396,12 +12980,6 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj)
|
||||||
// Mobjtype selection
|
// Mobjtype selection
|
||||||
switch (mobj->type)
|
switch (mobj->type)
|
||||||
{
|
{
|
||||||
case MT_SPRINGBALLPOINT:
|
|
||||||
macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE)
|
|
||||||
? MT_REDSPRINGBALL
|
|
||||||
: MT_YELLOWSPRINGBALL);
|
|
||||||
chainlink = MT_SMALLMACECHAIN;
|
|
||||||
break;
|
|
||||||
case MT_FIREBARPOINT:
|
case MT_FIREBARPOINT:
|
||||||
macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE)
|
macetype = ((mthing->thing_args[8] & TMM_DOUBLESIZE)
|
||||||
? MT_BIGFIREBAR
|
? MT_BIGFIREBAR
|
||||||
|
|
@ -13684,47 +13262,6 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean P_SetupBooster(mapthing_t* mthing, mobj_t* mobj, boolean strong)
|
|
||||||
{
|
|
||||||
angle_t angle = FixedAngle(mthing->angle << FRACBITS);
|
|
||||||
fixed_t x1 = FINECOSINE((angle >> ANGLETOFINESHIFT) & FINEMASK);
|
|
||||||
fixed_t y1 = FINESINE((angle >> ANGLETOFINESHIFT) & FINEMASK);
|
|
||||||
fixed_t x2 = FINECOSINE(((angle + ANGLE_90) >> ANGLETOFINESHIFT) & FINEMASK);
|
|
||||||
fixed_t y2 = FINESINE(((angle + ANGLE_90) >> ANGLETOFINESHIFT) & FINEMASK);
|
|
||||||
statenum_t facestate = strong ? S_REDBOOSTERSEG_FACE : S_YELLOWBOOSTERSEG_FACE;
|
|
||||||
statenum_t leftstate = strong ? S_REDBOOSTERSEG_LEFT : S_YELLOWBOOSTERSEG_LEFT;
|
|
||||||
statenum_t rightstate = strong ? S_REDBOOSTERSEG_RIGHT : S_YELLOWBOOSTERSEG_RIGHT;
|
|
||||||
statenum_t rollerstate = strong ? S_REDBOOSTERROLLER : S_YELLOWBOOSTERROLLER;
|
|
||||||
|
|
||||||
mobj_t *seg = P_SpawnMobjFromMobj(mobj, 26*x1, 26*y1, 0, MT_BOOSTERSEG);
|
|
||||||
seg->angle = angle - ANGLE_90;
|
|
||||||
P_SetMobjState(seg, facestate);
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, -26*x1, -26*y1, 0, MT_BOOSTERSEG);
|
|
||||||
seg->angle = angle + ANGLE_90;
|
|
||||||
P_SetMobjState(seg, facestate);
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, 21*x2, 21*y2, 0, MT_BOOSTERSEG);
|
|
||||||
seg->angle = angle;
|
|
||||||
P_SetMobjState(seg, leftstate);
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, -21*x2, -21*y2, 0, MT_BOOSTERSEG);
|
|
||||||
seg->angle = angle;
|
|
||||||
P_SetMobjState(seg, rightstate);
|
|
||||||
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, 13*(x1 + x2), 13*(y1 + y2), 0, MT_BOOSTERROLLER);
|
|
||||||
seg->angle = angle;
|
|
||||||
P_SetMobjState(seg, rollerstate);
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, 13*(x1 - x2), 13*(y1 - y2), 0, MT_BOOSTERROLLER);
|
|
||||||
seg->angle = angle;
|
|
||||||
P_SetMobjState(seg, rollerstate);
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, -13*(x1 + x2), -13*(y1 + y2), 0, MT_BOOSTERROLLER);
|
|
||||||
seg->angle = angle;
|
|
||||||
P_SetMobjState(seg, rollerstate);
|
|
||||||
seg = P_SpawnMobjFromMobj(mobj, -13*(x1 - x2), -13*(y1 - y2), 0, MT_BOOSTERROLLER);
|
|
||||||
seg->angle = angle;
|
|
||||||
P_SetMobjState(seg, rollerstate);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void P_SnapToFinishLine(mobj_t *mobj)
|
static void P_SnapToFinishLine(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
line_t *finishline = P_FindNearestLine(mobj->x, mobj->y,
|
line_t *finishline = P_FindNearestLine(mobj->x, mobj->y,
|
||||||
|
|
@ -13856,25 +13393,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
|
||||||
mobj->colorized = true;
|
mobj->colorized = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_FAN:
|
|
||||||
if (mthing->thing_args[1] & TMF_INVISIBLE)
|
|
||||||
{
|
|
||||||
P_UnsetThingPosition(mobj);
|
|
||||||
if (sector_list)
|
|
||||||
{
|
|
||||||
P_DelSeclist(sector_list);
|
|
||||||
sector_list = NULL;
|
|
||||||
}
|
|
||||||
mobj->flags |= MF_NOSECTOR; // this flag basically turns it invisible
|
|
||||||
P_SetThingPosition(mobj);
|
|
||||||
}
|
|
||||||
if (mthing->thing_args[1] & TMF_NODISTANCECHECK)
|
|
||||||
mobj->flags2 |= MF2_AMBUSH;
|
|
||||||
if (mthing->thing_args[0])
|
|
||||||
mobj->health = mthing->thing_args[0];
|
|
||||||
else
|
|
||||||
mobj->health = FixedMul(mobj->subsector->sector->ceilingheight - mobj->subsector->sector->floorheight, 3*(FRACUNIT/4)) >> FRACBITS;
|
|
||||||
break;
|
|
||||||
case MT_BALLOON:
|
case MT_BALLOON:
|
||||||
if (mthing->thing_stringargs[0])
|
if (mthing->thing_stringargs[0])
|
||||||
mobj->color = get_number(mthing->thing_stringargs[0]);
|
mobj->color = get_number(mthing->thing_stringargs[0]);
|
||||||
|
|
@ -13931,7 +13449,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
|
||||||
break;
|
break;
|
||||||
case MT_MACEPOINT:
|
case MT_MACEPOINT:
|
||||||
case MT_CHAINMACEPOINT:
|
case MT_CHAINMACEPOINT:
|
||||||
case MT_SPRINGBALLPOINT:
|
|
||||||
case MT_CHAINPOINT:
|
case MT_CHAINPOINT:
|
||||||
case MT_FIREBARPOINT:
|
case MT_FIREBARPOINT:
|
||||||
case MT_CUSTOMMACEPOINT:
|
case MT_CUSTOMMACEPOINT:
|
||||||
|
|
@ -14012,11 +13529,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MT_REDBOOSTER:
|
|
||||||
case MT_YELLOWBOOSTER:
|
|
||||||
if (!P_SetupBooster(mthing, mobj, mobj->type == MT_REDBOOSTER))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case MT_AXIS:
|
case MT_AXIS:
|
||||||
// Inverted if args[3] is set
|
// Inverted if args[3] is set
|
||||||
if (mthing->thing_args[3])
|
if (mthing->thing_args[3])
|
||||||
|
|
@ -14049,7 +13561,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
|
||||||
if (mthing->thing_args[2] & TMSF_RETRACTED)
|
if (mthing->thing_args[2] & TMSF_RETRACTED)
|
||||||
P_SetMobjState(mobj, mobj->info->meleestate);
|
P_SetMobjState(mobj, mobj->info->meleestate);
|
||||||
// Use per-thing collision for spikes unless the intangible flag is checked.
|
// Use per-thing collision for spikes unless the intangible flag is checked.
|
||||||
if (!(mthing->thing_args[2] & TMSF_INTANGIBLE) && !metalrecording)
|
if (!(mthing->thing_args[2] & TMSF_INTANGIBLE))
|
||||||
{
|
{
|
||||||
P_UnsetThingPosition(mobj);
|
P_UnsetThingPosition(mobj);
|
||||||
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT);
|
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT);
|
||||||
|
|
@ -14067,7 +13579,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
|
||||||
if (mthing->thing_args[2] & TMSF_RETRACTED)
|
if (mthing->thing_args[2] & TMSF_RETRACTED)
|
||||||
P_SetMobjState(mobj, mobj->info->meleestate);
|
P_SetMobjState(mobj, mobj->info->meleestate);
|
||||||
// Use per-thing collision for spikes unless the intangible flag is checked.
|
// Use per-thing collision for spikes unless the intangible flag is checked.
|
||||||
if (!(mthing->thing_args[2] & TMSF_INTANGIBLE) && !metalrecording)
|
if (!(mthing->thing_args[2] & TMSF_INTANGIBLE))
|
||||||
{
|
{
|
||||||
const fixed_t kSpriteRadius = 16 * mobj->scale;
|
const fixed_t kSpriteRadius = 16 * mobj->scale;
|
||||||
fixed_t x = FixedMul(mobj->radius - kSpriteRadius, FCOS(mobj->angle));
|
fixed_t x = FixedMul(mobj->radius - kSpriteRadius, FCOS(mobj->angle));
|
||||||
|
|
@ -14820,9 +14332,6 @@ mobj_t *P_SpawnMapThing(mapthing_t *mthing)
|
||||||
|
|
||||||
void P_SpawnHoop(mapthing_t *mthing)
|
void P_SpawnHoop(mapthing_t *mthing)
|
||||||
{
|
{
|
||||||
if (metalrecording)
|
|
||||||
return;
|
|
||||||
|
|
||||||
mobj_t *mobj = NULL;
|
mobj_t *mobj = NULL;
|
||||||
mobj_t *nextmobj = NULL;
|
mobj_t *nextmobj = NULL;
|
||||||
mobj_t *hoopcenter;
|
mobj_t *hoopcenter;
|
||||||
|
|
@ -15220,7 +14729,7 @@ mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type,
|
||||||
if (speed == 0)
|
if (speed == 0)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_GAMELOGIC, "P_SpawnXYZMissile - projectile has 0 speed! (mobj type %d)\n", type);
|
CONS_Debug(DBG_GAMELOGIC, "P_SpawnXYZMissile - projectile has 0 speed! (mobj type %d)\n", type);
|
||||||
speed = mobjinfo[MT_ROCKET].speed;
|
speed = FixedMul(20*FRACUNIT, th->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (th->info->seesound)
|
if (th->info->seesound)
|
||||||
|
|
@ -15281,8 +14790,8 @@ mobj_t *P_SpawnAlteredDirectionMissile(mobj_t *source, mobjtype_t type, fixed_t
|
||||||
|
|
||||||
if (speed == 0) // Backwards compatibility with 1.09.2
|
if (speed == 0) // Backwards compatibility with 1.09.2
|
||||||
{
|
{
|
||||||
CONS_Printf("P_SpawnAlteredDirectionMissile - projectile has 0 speed! (mobj type %d)\nPlease update this SOC.", type);
|
CONS_Debug(DBG_GAMELOGIC, "P_SpawnAlteredDirectionMissile - projectile has 0 speed! (mobj type %d)\nPlease update this SOC.", type);
|
||||||
speed = mobjinfo[MT_ROCKET].speed;
|
speed = FixedMul(20*FRACUNIT, th->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (th->info->seesound)
|
if (th->info->seesound)
|
||||||
|
|
@ -15346,8 +14855,8 @@ mobj_t *P_SpawnPointMissile(mobj_t *source, fixed_t xa, fixed_t ya, fixed_t za,
|
||||||
|
|
||||||
if (speed == 0) // Backwards compatibility with 1.09.2
|
if (speed == 0) // Backwards compatibility with 1.09.2
|
||||||
{
|
{
|
||||||
CONS_Printf("P_SpawnPointMissile - projectile has 0 speed! (mobj type %d)\nPlease update this SOC.", type);
|
CONS_Debug(DBG_GAMELOGIC, "P_SpawnPointMissile - projectile has 0 speed! (mobj type %d)\nPlease update this SOC.", type);
|
||||||
speed = mobjinfo[MT_ROCKET].speed;
|
speed = FixedMul(20*FRACUNIT, th->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (th->info->seesound)
|
if (th->info->seesound)
|
||||||
|
|
@ -15386,20 +14895,12 @@ mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type)
|
||||||
angle_t an;
|
angle_t an;
|
||||||
INT32 dist;
|
INT32 dist;
|
||||||
fixed_t z;
|
fixed_t z;
|
||||||
const fixed_t gsf = (fixed_t)6;
|
|
||||||
fixed_t speed;
|
fixed_t speed;
|
||||||
|
|
||||||
I_Assert(source != NULL);
|
I_Assert(source != NULL);
|
||||||
I_Assert(dest != NULL);
|
I_Assert(dest != NULL);
|
||||||
if (source->type == MT_JETTGUNNER)
|
|
||||||
{
|
z = source->z + source->height/2;
|
||||||
if (source->eflags & MFE_VERTICALFLIP)
|
|
||||||
z = source->z + source->height - FixedMul(4*FRACUNIT, source->scale);
|
|
||||||
else
|
|
||||||
z = source->z + FixedMul(4*FRACUNIT, source->scale);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
z = source->z + source->height/2;
|
|
||||||
|
|
||||||
if (source->eflags & MFE_VERTICALFLIP)
|
if (source->eflags & MFE_VERTICALFLIP)
|
||||||
z -= FixedMul(mobjinfo[type].height, source->scale);
|
z -= FixedMul(mobjinfo[type].height, source->scale);
|
||||||
|
|
@ -15412,15 +14913,12 @@ mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type)
|
||||||
th->destscale = source->scale;
|
th->destscale = source->scale;
|
||||||
P_SetScale(th, source->scale);
|
P_SetScale(th, source->scale);
|
||||||
|
|
||||||
if (source->type == MT_METALSONIC_BATTLE && source->health < 4)
|
speed = FixedMul(th->info->speed, th->scale);
|
||||||
speed = FixedMul(FixedMul(th->info->speed, 3*FRACUNIT/2), th->scale);
|
|
||||||
else
|
|
||||||
speed = FixedMul(th->info->speed, th->scale);
|
|
||||||
|
|
||||||
if (speed == 0)
|
if (speed == 0)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_GAMELOGIC, "P_SpawnMissile - projectile has 0 speed! (mobj type %d)\n", type);
|
CONS_Debug(DBG_GAMELOGIC, "P_SpawnMissile - projectile has 0 speed! (mobj type %d)\n", type);
|
||||||
speed = FixedMul(mobjinfo[MT_TURRETLASER].speed, th->scale);
|
speed = FixedMul(20*FRACUNIT, th->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (th->info->seesound)
|
if (th->info->seesound)
|
||||||
|
|
@ -15428,32 +14926,21 @@ mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type)
|
||||||
|
|
||||||
P_SetTarget(&th->target, source); // where it came from
|
P_SetTarget(&th->target, source); // where it came from
|
||||||
|
|
||||||
if (type == MT_TURRETLASER || type == MT_ENERGYBALL) // More accurate!
|
an = R_PointToAngle2(source->x, source->y, dest->x, dest->y);
|
||||||
an = R_PointToAngle2(source->x, source->y,
|
|
||||||
dest->x + (dest->momx*gsf),
|
|
||||||
dest->y + (dest->momy*gsf));
|
|
||||||
else
|
|
||||||
an = R_PointToAngle2(source->x, source->y, dest->x, dest->y);
|
|
||||||
|
|
||||||
th->angle = an;
|
th->angle = an;
|
||||||
an >>= ANGLETOFINESHIFT;
|
an >>= ANGLETOFINESHIFT;
|
||||||
th->momx = FixedMul(speed, FINECOSINE(an));
|
th->momx = FixedMul(speed, FINECOSINE(an));
|
||||||
th->momy = FixedMul(speed, FINESINE(an));
|
th->momy = FixedMul(speed, FINESINE(an));
|
||||||
|
|
||||||
if (type == MT_TURRETLASER || type == MT_ENERGYBALL) // More accurate!
|
dist = P_AproxDistance(dest->x - source->x, dest->y - source->y);
|
||||||
dist = P_AproxDistance(dest->x+(dest->momx*gsf) - source->x, dest->y+(dest->momy*gsf) - source->y);
|
|
||||||
else
|
|
||||||
dist = P_AproxDistance(dest->x - source->x, dest->y - source->y);
|
|
||||||
|
|
||||||
dist = dist / speed;
|
dist = dist / speed;
|
||||||
|
|
||||||
if (dist < 1)
|
if (dist < 1)
|
||||||
dist = 1;
|
dist = 1;
|
||||||
|
|
||||||
if (type == MT_TURRETLASER || type == MT_ENERGYBALL) // More accurate!
|
th->momz = (dest->z - z) / dist;
|
||||||
th->momz = (dest->z + (dest->momz*gsf) - z) / dist;
|
|
||||||
else
|
|
||||||
th->momz = (dest->z - z) / dist;
|
|
||||||
|
|
||||||
if (th->flags & MF_MISSILE)
|
if (th->flags & MF_MISSILE)
|
||||||
dist = P_CheckMissileSpawn(th);
|
dist = P_CheckMissileSpawn(th);
|
||||||
|
|
|
||||||
|
|
@ -5925,14 +5925,6 @@ static inline void P_NetArchiveSpecials(savebuffer_t *save)
|
||||||
// Current global weather type
|
// Current global weather type
|
||||||
WRITEUINT8(save->p, globalweather);
|
WRITEUINT8(save->p, globalweather);
|
||||||
|
|
||||||
if (metalplayback) // Is metal sonic running?
|
|
||||||
{
|
|
||||||
WRITEUINT8(save->p, 0x01);
|
|
||||||
G_SaveMetal(&save->p);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
WRITEUINT8(save->p, 0x00);
|
|
||||||
|
|
||||||
TracyCZoneEnd(__zone);
|
TracyCZoneEnd(__zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5973,9 +5965,6 @@ static void P_NetUnArchiveSpecials(savebuffer_t *save)
|
||||||
P_SwitchWeather(globalweather);
|
P_SwitchWeather(globalweather);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (READUINT8(save->p) == 0x01) // metal sonic
|
|
||||||
G_LoadMetal(&save->p);
|
|
||||||
|
|
||||||
TracyCZoneEnd(__zone);
|
TracyCZoneEnd(__zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8237,9 +8237,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
||||||
// Initialize sector node list.
|
// Initialize sector node list.
|
||||||
P_Initsecnode();
|
P_Initsecnode();
|
||||||
|
|
||||||
if (metalplayback)
|
|
||||||
G_StopMetalDemo();
|
|
||||||
|
|
||||||
// Clear CECHO messages
|
// Clear CECHO messages
|
||||||
HU_ClearCEcho();
|
HU_ClearCEcho();
|
||||||
HU_ClearTitlecardCEcho();
|
HU_ClearTitlecardCEcho();
|
||||||
|
|
@ -8736,8 +8733,6 @@ void P_PostLoadLevel(void)
|
||||||
|
|
||||||
P_InitPlayers();
|
P_InitPlayers();
|
||||||
|
|
||||||
if (metalrecording)
|
|
||||||
G_BeginMetal();
|
|
||||||
if (demo.recording) // Okay, level loaded, character spawned and skinned,
|
if (demo.recording) // Okay, level loaded, character spawned and skinned,
|
||||||
G_BeginRecording(); // I AM NOW READY TO RECORD.
|
G_BeginRecording(); // I AM NOW READY TO RECORD.
|
||||||
demo.deferstart = true;
|
demo.deferstart = true;
|
||||||
|
|
|
||||||
13
src/p_spec.c
13
src/p_spec.c
|
|
@ -3419,11 +3419,6 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 440: // Play race countdown and start Metal Sonic
|
|
||||||
if (!metalrecording && !metalplayback)
|
|
||||||
G_DoPlayMetal();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 441: // Trigger unlockable
|
case 441: // Trigger unlockable
|
||||||
{
|
{
|
||||||
INT32 trigid = args[0];
|
INT32 trigid = args[0];
|
||||||
|
|
@ -5288,10 +5283,10 @@ static void P_EvaluateSpecialFlags(player_t *player, sector_t *sector, sector_t
|
||||||
P_ProcessExitSector(player, sectag);
|
P_ProcessExitSector(player, sectag);
|
||||||
if (sector->specialflags & SSF_FAN)
|
if (sector->specialflags & SSF_FAN)
|
||||||
{
|
{
|
||||||
player->mo->momz += mobjinfo[MT_FAN].mass/4;
|
player->mo->momz += (5*FRACUNIT)/4;
|
||||||
|
|
||||||
if (player->mo->momz > mobjinfo[MT_FAN].mass)
|
if (player->mo->momz > (5*FRACUNIT))
|
||||||
player->mo->momz = mobjinfo[MT_FAN].mass;
|
player->mo->momz = (5*FRACUNIT);
|
||||||
|
|
||||||
P_ResetPlayer(player);
|
P_ResetPlayer(player);
|
||||||
/*
|
/*
|
||||||
|
|
@ -6645,8 +6640,6 @@ void T_LaserFlash(laserthink_t *flash)
|
||||||
|
|
||||||
if (thing->flags & MF_SHOOTABLE)
|
if (thing->flags & MF_SHOOTABLE)
|
||||||
P_DamageMobj(thing, NULL, NULL, 1, DMG_NORMAL);
|
P_DamageMobj(thing, NULL, NULL, 1, DMG_NORMAL);
|
||||||
else if (thing->type == MT_EGGSHIELD)
|
|
||||||
P_KillMobj(thing, NULL, NULL, DMG_NORMAL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1157,11 +1157,6 @@ void P_Ticker(boolean run)
|
||||||
quake = quake->next;
|
quake = quake->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metalplayback)
|
|
||||||
G_ReadMetalTic(metalplayback);
|
|
||||||
if (metalrecording)
|
|
||||||
G_WriteMetalTic(players[consoleplayer].mo);
|
|
||||||
|
|
||||||
if (demo.recording)
|
if (demo.recording)
|
||||||
{
|
{
|
||||||
G_WriteAllGhostTics();
|
G_WriteAllGhostTics();
|
||||||
|
|
|
||||||
86
src/p_user.c
86
src/p_user.c
|
|
@ -316,89 +316,6 @@ UINT8 P_GetNextEmerald(void)
|
||||||
return cup->emeraldnum;
|
return cup->emeraldnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// P_GiveEmerald
|
|
||||||
//
|
|
||||||
// Award an emerald upon completion
|
|
||||||
// of a special stage.
|
|
||||||
//
|
|
||||||
void P_GiveEmerald(boolean spawnObj)
|
|
||||||
{
|
|
||||||
UINT8 em = P_GetNextEmerald();
|
|
||||||
|
|
||||||
S_StartSound(NULL, sfx_cgot); // Got the emerald!
|
|
||||||
stagefailed = false;
|
|
||||||
|
|
||||||
if (spawnObj)
|
|
||||||
{
|
|
||||||
// The Chaos Emerald begins to orbit us!
|
|
||||||
// Only visibly give it to ONE person!
|
|
||||||
UINT8 i, pnum = ((playeringame[consoleplayer]) && (!players[consoleplayer].spectator) && (players[consoleplayer].mo)) ? consoleplayer : 255;
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
|
||||||
{
|
|
||||||
mobj_t *emmo;
|
|
||||||
if (!playeringame[i])
|
|
||||||
continue;
|
|
||||||
if (players[i].spectator)
|
|
||||||
continue;
|
|
||||||
if (!players[i].mo)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
emmo = P_SpawnMobjFromMobj(players[i].mo, 0, 0, players[i].mo->height, MT_GOTEMERALD);
|
|
||||||
if (!emmo)
|
|
||||||
continue;
|
|
||||||
P_SetTarget(&emmo->target, players[i].mo);
|
|
||||||
P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em);
|
|
||||||
|
|
||||||
// Make sure we're not being carried before our tracer is changed
|
|
||||||
players[i].carry = CR_NONE;
|
|
||||||
|
|
||||||
P_SetTarget(&players[i].mo->tracer, emmo);
|
|
||||||
|
|
||||||
if (pnum == 255)
|
|
||||||
{
|
|
||||||
pnum = i;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i == pnum)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
emmo->flags2 |= RF_DONTDRAW;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// P_GiveFinishFlags
|
|
||||||
//
|
|
||||||
// Give the player visual indicators
|
|
||||||
// that they've finished the map.
|
|
||||||
//
|
|
||||||
void P_GiveFinishFlags(player_t *player)
|
|
||||||
{
|
|
||||||
angle_t angle = FixedAngle(player->mo->angle << FRACBITS);
|
|
||||||
UINT8 i;
|
|
||||||
|
|
||||||
if (!player->mo)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!(netgame||multiplayer))
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
|
||||||
{
|
|
||||||
angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK;
|
|
||||||
fixed_t xoffs = FINECOSINE(fa);
|
|
||||||
fixed_t yoffs = FINESINE(fa);
|
|
||||||
mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG);
|
|
||||||
flag->angle = angle;
|
|
||||||
angle += FixedAngle(120*FRACUNIT);
|
|
||||||
|
|
||||||
P_SetTarget(&flag->target, player->mo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_FindLowestLap
|
// P_FindLowestLap
|
||||||
//
|
//
|
||||||
|
|
@ -1607,9 +1524,6 @@ static void P_CheckBustableBlocks(player_t *player)
|
||||||
player->mo->momy >>= 1;
|
player->mo->momy >>= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (metalrecording)
|
|
||||||
// G_RecordBustup(rover);
|
|
||||||
|
|
||||||
EV_CrumbleChain(NULL, rover); // node->m_sector
|
EV_CrumbleChain(NULL, rover); // node->m_sector
|
||||||
|
|
||||||
// Run a linedef executor??
|
// Run a linedef executor??
|
||||||
|
|
|
||||||
|
|
@ -1653,8 +1653,6 @@ void I_Quit(void)
|
||||||
|
|
||||||
if (demo.recording)
|
if (demo.recording)
|
||||||
G_CheckDemoStatus();
|
G_CheckDemoStatus();
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalRecording(false);
|
|
||||||
|
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
// Join up with thread if waiting
|
// Join up with thread if waiting
|
||||||
|
|
@ -1787,8 +1785,6 @@ void I_Error(const char *error, ...)
|
||||||
#ifndef TESTERS
|
#ifndef TESTERS
|
||||||
if (demo.recording)
|
if (demo.recording)
|
||||||
G_CheckDemoStatus();
|
G_CheckDemoStatus();
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalRecording(false);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
D_QuitNetGame();
|
D_QuitNetGame();
|
||||||
|
|
|
||||||
|
|
@ -2992,8 +2992,6 @@ void I_Quit(void)
|
||||||
|
|
||||||
if (demorecording)
|
if (demorecording)
|
||||||
G_CheckDemoStatus();
|
G_CheckDemoStatus();
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalRecording();
|
|
||||||
|
|
||||||
D_QuitNetGame();
|
D_QuitNetGame();
|
||||||
I_ShutdownMusic();
|
I_ShutdownMusic();
|
||||||
|
|
@ -3149,8 +3147,6 @@ void I_Error(const char *error, ...)
|
||||||
// Shutdown. Here might be other errors.
|
// Shutdown. Here might be other errors.
|
||||||
if (demorecording)
|
if (demorecording)
|
||||||
G_CheckDemoStatus();
|
G_CheckDemoStatus();
|
||||||
if (metalrecording)
|
|
||||||
G_StopMetalRecording();
|
|
||||||
|
|
||||||
D_QuitNetGame();
|
D_QuitNetGame();
|
||||||
I_ShutdownMusic();
|
I_ShutdownMusic();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue