mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
(Mostly) adapt the Ideya Drone to UDMF
This commit is contained in:
parent
5918ecc2fe
commit
52c319167f
5 changed files with 309 additions and 263 deletions
|
@ -6374,6 +6374,30 @@ udmf
|
|||
sprite = "NDRNA1";
|
||||
width = 16;
|
||||
height = 56;
|
||||
arg0
|
||||
{
|
||||
title = "Time limit";
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Height";
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Radius";
|
||||
}
|
||||
arg3
|
||||
{
|
||||
title = "Alignment";
|
||||
type = 11;
|
||||
enum
|
||||
{
|
||||
0 = "Bottom with offset";
|
||||
1 = "Bottom";
|
||||
2 = "Middle";
|
||||
3 = "Top";
|
||||
}
|
||||
}
|
||||
}
|
||||
1704
|
||||
{
|
||||
|
|
519
src/p_mobj.c
519
src/p_mobj.c
|
@ -8692,245 +8692,242 @@ static boolean P_EggRobo1Think(mobj_t *mobj)
|
|||
|
||||
static void P_NiGHTSDroneThink(mobj_t *mobj)
|
||||
{
|
||||
mobj_t *goalpost = NULL;
|
||||
mobj_t *sparkle = NULL;
|
||||
mobj_t *droneman = NULL;
|
||||
|
||||
boolean flip = mobj->flags2 & MF2_OBJECTFLIP;
|
||||
boolean topaligned = (mobj->flags & MF_SLIDEME) && !(mobj->flags & MF_GRENADEBOUNCE);
|
||||
boolean middlealigned = (mobj->flags & MF_GRENADEBOUNCE) && !(mobj->flags & MF_SLIDEME);
|
||||
boolean bottomoffsetted = !(mobj->flags & MF_SLIDEME) && !(mobj->flags & MF_GRENADEBOUNCE);
|
||||
boolean flipchanged = false;
|
||||
|
||||
fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff;
|
||||
|
||||
if (mobj->target && mobj->target->type == MT_NIGHTSDRONE_GOAL)
|
||||
{
|
||||
// variable setup
|
||||
mobj_t *goalpost = NULL;
|
||||
mobj_t *sparkle = NULL;
|
||||
mobj_t *droneman = NULL;
|
||||
goalpost = mobj->target;
|
||||
if (goalpost->target && goalpost->target->type == MT_NIGHTSDRONE_SPARKLING)
|
||||
sparkle = goalpost->target;
|
||||
if (goalpost->tracer && goalpost->tracer->type == MT_NIGHTSDRONE_MAN)
|
||||
droneman = goalpost->tracer;
|
||||
}
|
||||
|
||||
boolean flip = mobj->flags2 & MF2_OBJECTFLIP;
|
||||
boolean topaligned = (mobj->flags & MF_SLIDEME) && !(mobj->flags & MF_GRENADEBOUNCE);
|
||||
boolean middlealigned = (mobj->flags & MF_GRENADEBOUNCE) && !(mobj->flags & MF_SLIDEME);
|
||||
boolean bottomoffsetted = !(mobj->flags & MF_SLIDEME) && !(mobj->flags & MF_GRENADEBOUNCE);
|
||||
boolean flipchanged = false;
|
||||
if (!goalpost || !sparkle || !droneman)
|
||||
return;
|
||||
|
||||
fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff;
|
||||
// did NIGHTSDRONE position, scale, flip, or flags change? all elements need to be synced
|
||||
droneboxmandiff = max(mobj->height - droneman->height, 0);
|
||||
dronemangoaldiff = max(droneman->height - goalpost->height, 0);
|
||||
|
||||
if (mobj->target && mobj->target->type == MT_NIGHTSDRONE_GOAL)
|
||||
if (!(goalpost->flags2 & MF2_OBJECTFLIP) && (mobj->flags2 & MF2_OBJECTFLIP))
|
||||
{
|
||||
goalpost->eflags |= MFE_VERTICALFLIP;
|
||||
goalpost->flags2 |= MF2_OBJECTFLIP;
|
||||
sparkle->eflags |= MFE_VERTICALFLIP;
|
||||
sparkle->flags2 |= MF2_OBJECTFLIP;
|
||||
droneman->eflags |= MFE_VERTICALFLIP;
|
||||
droneman->flags2 |= MF2_OBJECTFLIP;
|
||||
flipchanged = true;
|
||||
}
|
||||
else if ((goalpost->flags2 & MF2_OBJECTFLIP) && !(mobj->flags2 & MF2_OBJECTFLIP))
|
||||
{
|
||||
goalpost->eflags &= ~MFE_VERTICALFLIP;
|
||||
goalpost->flags2 &= ~MF2_OBJECTFLIP;
|
||||
sparkle->eflags &= ~MFE_VERTICALFLIP;
|
||||
sparkle->flags2 &= ~MF2_OBJECTFLIP;
|
||||
droneman->eflags &= ~MFE_VERTICALFLIP;
|
||||
droneman->flags2 &= ~MF2_OBJECTFLIP;
|
||||
flipchanged = true;
|
||||
}
|
||||
|
||||
if (goalpost->destscale != mobj->destscale
|
||||
|| goalpost->movefactor != mobj->z
|
||||
|| goalpost->friction != mobj->height
|
||||
|| flipchanged
|
||||
|| goalpost->threshold != (INT32)(mobj->flags & (MF_SLIDEME|MF_GRENADEBOUNCE)))
|
||||
{
|
||||
goalpost->destscale = sparkle->destscale = droneman->destscale = mobj->destscale;
|
||||
|
||||
// straight copy-pasta from P_SpawnMapThing, case MT_NIGHTSDRONE
|
||||
if (!flip)
|
||||
{
|
||||
goalpost = mobj->target;
|
||||
if (goalpost->target && goalpost->target->type == MT_NIGHTSDRONE_SPARKLING)
|
||||
sparkle = goalpost->target;
|
||||
if (goalpost->tracer && goalpost->tracer->type == MT_NIGHTSDRONE_MAN)
|
||||
droneman = goalpost->tracer;
|
||||
}
|
||||
|
||||
if (!goalpost || !sparkle || !droneman)
|
||||
return;
|
||||
|
||||
// did NIGHTSDRONE position, scale, flip, or flags change? all elements need to be synced
|
||||
droneboxmandiff = max(mobj->height - droneman->height, 0);
|
||||
dronemangoaldiff = max(droneman->height - goalpost->height, 0);
|
||||
|
||||
if (!(goalpost->flags2 & MF2_OBJECTFLIP) && (mobj->flags2 & MF2_OBJECTFLIP))
|
||||
{
|
||||
goalpost->eflags |= MFE_VERTICALFLIP;
|
||||
goalpost->flags2 |= MF2_OBJECTFLIP;
|
||||
sparkle->eflags |= MFE_VERTICALFLIP;
|
||||
sparkle->flags2 |= MF2_OBJECTFLIP;
|
||||
droneman->eflags |= MFE_VERTICALFLIP;
|
||||
droneman->flags2 |= MF2_OBJECTFLIP;
|
||||
flipchanged = true;
|
||||
}
|
||||
else if ((goalpost->flags2 & MF2_OBJECTFLIP) && !(mobj->flags2 & MF2_OBJECTFLIP))
|
||||
{
|
||||
goalpost->eflags &= ~MFE_VERTICALFLIP;
|
||||
goalpost->flags2 &= ~MF2_OBJECTFLIP;
|
||||
sparkle->eflags &= ~MFE_VERTICALFLIP;
|
||||
sparkle->flags2 &= ~MF2_OBJECTFLIP;
|
||||
droneman->eflags &= ~MFE_VERTICALFLIP;
|
||||
droneman->flags2 &= ~MF2_OBJECTFLIP;
|
||||
flipchanged = true;
|
||||
}
|
||||
|
||||
if (goalpost->destscale != mobj->destscale
|
||||
|| goalpost->movefactor != mobj->z
|
||||
|| goalpost->friction != mobj->height
|
||||
|| flipchanged
|
||||
|| goalpost->threshold != (INT32)(mobj->flags & (MF_SLIDEME|MF_GRENADEBOUNCE)))
|
||||
{
|
||||
goalpost->destscale = sparkle->destscale = droneman->destscale = mobj->destscale;
|
||||
|
||||
// straight copy-pasta from P_SpawnMapThing, case MT_NIGHTSDRONE
|
||||
if (!flip)
|
||||
if (topaligned) // Align droneman to top of hitbox
|
||||
{
|
||||
if (topaligned) // Align droneman to top of hitbox
|
||||
{
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (middlealigned) // Align droneman to center of hitbox
|
||||
{
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (bottomoffsetted)
|
||||
{
|
||||
dronemanoffset = 24*FRACUNIT;
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
|
||||
sparkleoffset = goaloffset - FixedMul(15*FRACUNIT, mobj->scale);
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (middlealigned) // Align droneman to center of hitbox
|
||||
{
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (bottomoffsetted)
|
||||
{
|
||||
dronemanoffset = 24*FRACUNIT;
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (topaligned) // Align droneman to top of hitbox
|
||||
{
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (middlealigned) // Align droneman to center of hitbox
|
||||
{
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (bottomoffsetted)
|
||||
{
|
||||
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
|
||||
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
|
||||
P_TeleportMove(goalpost, mobj->x, mobj->y, mobj->z + goaloffset);
|
||||
P_TeleportMove(sparkle, mobj->x, mobj->y, mobj->z + sparkleoffset);
|
||||
if (goalpost->movefactor != mobj->z || goalpost->friction != mobj->height)
|
||||
{
|
||||
P_TeleportMove(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset);
|
||||
goalpost->movefactor = mobj->z;
|
||||
goalpost->friction = mobj->height;
|
||||
}
|
||||
goalpost->threshold = mobj->flags & (MF_SLIDEME|MF_GRENADEBOUNCE);
|
||||
sparkleoffset = goaloffset - FixedMul(15*FRACUNIT, mobj->scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (goalpost->x != mobj->x || goalpost->y != mobj->y)
|
||||
if (topaligned) // Align droneman to top of hitbox
|
||||
{
|
||||
P_TeleportMove(goalpost, mobj->x, mobj->y, goalpost->z);
|
||||
P_TeleportMove(sparkle, mobj->x, mobj->y, sparkle->z);
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
|
||||
if (droneman->x != mobj->x || droneman->y != mobj->y)
|
||||
P_TeleportMove(droneman, mobj->x, mobj->y,
|
||||
droneman->z >= mobj->floorz && droneman->z <= mobj->ceilingz ? droneman->z : mobj->z);
|
||||
}
|
||||
|
||||
// now toggle states!
|
||||
// GOAL mode?
|
||||
if (sparkle->state >= &states[S_NIGHTSDRONE_SPARKLING1] && sparkle->state <= &states[S_NIGHTSDRONE_SPARKLING16])
|
||||
{
|
||||
INT32 i;
|
||||
boolean bonustime = false;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].bonustime && players[i].powers[pw_carry] == CR_NIGHTSMODE)
|
||||
{
|
||||
bonustime = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bonustime)
|
||||
else if (middlealigned) // Align droneman to center of hitbox
|
||||
{
|
||||
CONS_Debug(DBG_NIGHTSBASIC, "Removing goal post\n");
|
||||
if (goalpost && goalpost->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(goalpost, S_INVISIBLE);
|
||||
if (sparkle && sparkle->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(sparkle, S_INVISIBLE);
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
}
|
||||
// Invisible/bouncing mode.
|
||||
else
|
||||
{
|
||||
INT32 i;
|
||||
boolean bonustime = false;
|
||||
fixed_t zcomp;
|
||||
|
||||
// Bouncy bouncy!
|
||||
if (!flip)
|
||||
else if (bottomoffsetted)
|
||||
{
|
||||
if (topaligned)
|
||||
zcomp = droneboxmandiff + mobj->z;
|
||||
else if (middlealigned)
|
||||
zcomp = (droneboxmandiff/2) + mobj->z;
|
||||
else if (bottomoffsetted)
|
||||
zcomp = mobj->z + FixedMul(24*FRACUNIT, mobj->scale);
|
||||
else
|
||||
zcomp = mobj->z;
|
||||
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (topaligned)
|
||||
zcomp = mobj->z;
|
||||
else if (middlealigned)
|
||||
zcomp = (droneboxmandiff/2) + mobj->z;
|
||||
else if (bottomoffsetted)
|
||||
zcomp = mobj->z + droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||
else
|
||||
zcomp = mobj->z + droneboxmandiff;
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
|
||||
droneman->angle += ANG10;
|
||||
if (!flip && droneman->z <= zcomp)
|
||||
droneman->momz = FixedMul(5*FRACUNIT, droneman->scale);
|
||||
else if (flip && droneman->z >= zcomp)
|
||||
droneman->momz = FixedMul(-5*FRACUNIT, droneman->scale);
|
||||
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
||||
}
|
||||
|
||||
// state switching logic
|
||||
P_TeleportMove(goalpost, mobj->x, mobj->y, mobj->z + goaloffset);
|
||||
P_TeleportMove(sparkle, mobj->x, mobj->y, mobj->z + sparkleoffset);
|
||||
if (goalpost->movefactor != mobj->z || goalpost->friction != mobj->height)
|
||||
{
|
||||
P_TeleportMove(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset);
|
||||
goalpost->movefactor = mobj->z;
|
||||
goalpost->friction = mobj->height;
|
||||
}
|
||||
goalpost->threshold = mobj->flags & (MF_SLIDEME|MF_GRENADEBOUNCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (goalpost->x != mobj->x || goalpost->y != mobj->y)
|
||||
{
|
||||
P_TeleportMove(goalpost, mobj->x, mobj->y, goalpost->z);
|
||||
P_TeleportMove(sparkle, mobj->x, mobj->y, sparkle->z);
|
||||
}
|
||||
|
||||
if (droneman->x != mobj->x || droneman->y != mobj->y)
|
||||
P_TeleportMove(droneman, mobj->x, mobj->y,
|
||||
droneman->z >= mobj->floorz && droneman->z <= mobj->ceilingz ? droneman->z : mobj->z);
|
||||
}
|
||||
|
||||
// now toggle states!
|
||||
// GOAL mode?
|
||||
if (sparkle->state >= &states[S_NIGHTSDRONE_SPARKLING1] && sparkle->state <= &states[S_NIGHTSDRONE_SPARKLING16])
|
||||
{
|
||||
INT32 i;
|
||||
boolean bonustime = false;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].bonustime && players[i].powers[pw_carry] == CR_NIGHTSMODE)
|
||||
{
|
||||
bonustime = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bonustime)
|
||||
{
|
||||
CONS_Debug(DBG_NIGHTSBASIC, "Removing goal post\n");
|
||||
if (goalpost && goalpost->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(goalpost, S_INVISIBLE);
|
||||
if (sparkle && sparkle->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(sparkle, S_INVISIBLE);
|
||||
}
|
||||
}
|
||||
// Invisible/bouncing mode.
|
||||
else
|
||||
{
|
||||
INT32 i;
|
||||
boolean bonustime = false;
|
||||
fixed_t zcomp;
|
||||
|
||||
// Bouncy bouncy!
|
||||
if (!flip)
|
||||
{
|
||||
if (topaligned)
|
||||
zcomp = droneboxmandiff + mobj->z;
|
||||
else if (middlealigned)
|
||||
zcomp = (droneboxmandiff/2) + mobj->z;
|
||||
else if (bottomoffsetted)
|
||||
zcomp = mobj->z + FixedMul(24*FRACUNIT, mobj->scale);
|
||||
else
|
||||
zcomp = mobj->z;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (topaligned)
|
||||
zcomp = mobj->z;
|
||||
else if (middlealigned)
|
||||
zcomp = (droneboxmandiff/2) + mobj->z;
|
||||
else if (bottomoffsetted)
|
||||
zcomp = mobj->z + droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||
else
|
||||
zcomp = mobj->z + droneboxmandiff;
|
||||
}
|
||||
|
||||
droneman->angle += ANG10;
|
||||
if (!flip && droneman->z <= zcomp)
|
||||
droneman->momz = FixedMul(5*FRACUNIT, droneman->scale);
|
||||
else if (flip && droneman->z >= zcomp)
|
||||
droneman->momz = FixedMul(-5*FRACUNIT, droneman->scale);
|
||||
|
||||
// state switching logic
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].bonustime && players[i].powers[pw_carry] == CR_NIGHTSMODE)
|
||||
{
|
||||
bonustime = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bonustime)
|
||||
{
|
||||
CONS_Debug(DBG_NIGHTSBASIC, "Adding goal post\n");
|
||||
if (!(droneman->flags2 & MF2_DONTDRAW))
|
||||
droneman->flags2 |= MF2_DONTDRAW;
|
||||
if (goalpost->state == &states[S_INVISIBLE])
|
||||
P_SetMobjState(goalpost, mobjinfo[goalpost->type].meleestate);
|
||||
if (sparkle->state == &states[S_INVISIBLE])
|
||||
P_SetMobjState(sparkle, mobjinfo[sparkle->type].meleestate);
|
||||
}
|
||||
else if (!G_IsSpecialStage(gamemap))
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].bonustime && players[i].powers[pw_carry] == CR_NIGHTSMODE)
|
||||
if (playeringame[i] && players[i].powers[pw_carry] != CR_NIGHTSMODE)
|
||||
{
|
||||
bonustime = true;
|
||||
bonustime = true; // variable reuse
|
||||
break;
|
||||
}
|
||||
|
||||
if (bonustime)
|
||||
{
|
||||
CONS_Debug(DBG_NIGHTSBASIC, "Adding goal post\n");
|
||||
// show droneman if at least one player is non-nights
|
||||
if (goalpost->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(goalpost, S_INVISIBLE);
|
||||
if (sparkle->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(sparkle, S_INVISIBLE);
|
||||
if (droneman->state != &states[mobjinfo[droneman->type].meleestate])
|
||||
P_SetMobjState(droneman, mobjinfo[droneman->type].meleestate);
|
||||
if (droneman->flags2 & MF2_DONTDRAW)
|
||||
droneman->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else
|
||||
{
|
||||
// else, hide it
|
||||
if (!(droneman->flags2 & MF2_DONTDRAW))
|
||||
droneman->flags2 |= MF2_DONTDRAW;
|
||||
if (goalpost->state == &states[S_INVISIBLE])
|
||||
P_SetMobjState(goalpost, mobjinfo[goalpost->type].meleestate);
|
||||
if (sparkle->state == &states[S_INVISIBLE])
|
||||
P_SetMobjState(sparkle, mobjinfo[sparkle->type].meleestate);
|
||||
}
|
||||
else if (!G_IsSpecialStage(gamemap))
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].powers[pw_carry] != CR_NIGHTSMODE)
|
||||
{
|
||||
bonustime = true; // variable reuse
|
||||
break;
|
||||
}
|
||||
|
||||
if (bonustime)
|
||||
{
|
||||
// show droneman if at least one player is non-nights
|
||||
if (goalpost->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(goalpost, S_INVISIBLE);
|
||||
if (sparkle->state != &states[S_INVISIBLE])
|
||||
P_SetMobjState(sparkle, S_INVISIBLE);
|
||||
if (droneman->state != &states[mobjinfo[droneman->type].meleestate])
|
||||
P_SetMobjState(droneman, mobjinfo[droneman->type].meleestate);
|
||||
if (droneman->flags2 & MF2_DONTDRAW)
|
||||
droneman->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else
|
||||
{
|
||||
// else, hide it
|
||||
if (!(droneman->flags2 & MF2_DONTDRAW))
|
||||
droneman->flags2 |= MF2_DONTDRAW;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12496,16 +12493,13 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj)
|
|||
return true;
|
||||
}
|
||||
|
||||
static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
||||
static boolean P_SetupNiGHTSDrone(mapthing_t *mthing, mobj_t *mobj)
|
||||
{
|
||||
boolean flip = mthing->options & MTF_OBJECTFLIP;
|
||||
boolean topaligned = (mthing->options & MTF_OBJECTSPECIAL) && !(mthing->options & MTF_EXTRA);
|
||||
boolean middlealigned = (mthing->options & MTF_EXTRA) && !(mthing->options & MTF_OBJECTSPECIAL);
|
||||
boolean bottomoffsetted = !(mthing->options & MTF_OBJECTSPECIAL) && !(mthing->options & MTF_EXTRA);
|
||||
|
||||
INT16 timelimit = mthing->angle & 0xFFF;
|
||||
fixed_t hitboxradius = ((mthing->angle & 0xF000) >> 12)*32*FRACUNIT;
|
||||
fixed_t hitboxheight = mthing->extrainfo*32*FRACUNIT;
|
||||
INT16 timelimit = mthing->args[0];
|
||||
fixed_t hitboxheight = mthing->args[1] << FRACBITS;
|
||||
fixed_t hitboxradius = mthing->args[2] << FRACBITS;
|
||||
INT32 dronemanalignment = mthing->args[3];
|
||||
fixed_t oldheight = mobj->height;
|
||||
fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff;
|
||||
|
||||
|
@ -12528,25 +12522,25 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
|||
|
||||
if (!flip)
|
||||
{
|
||||
if (topaligned) // Align droneman to top of hitbox
|
||||
switch (dronemanalignment)
|
||||
{
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (middlealigned) // Align droneman to center of hitbox
|
||||
{
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (bottomoffsetted)
|
||||
{
|
||||
dronemanoffset = 24*FRACUNIT;
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
case TMDA_BOTTOMOFFSET:
|
||||
default:
|
||||
dronemanoffset = FixedMul(24*FRACUNIT, mobj->scale);
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
break;
|
||||
case TMDA_BOTTOM:
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
break;
|
||||
case TMDA_MIDDLE:
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
break;
|
||||
case TMDA_TOP:
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
break;
|
||||
}
|
||||
|
||||
sparkleoffset = goaloffset - FixedMul(15*FRACUNIT, mobj->scale);
|
||||
|
@ -12556,25 +12550,25 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
|||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
|
||||
if (topaligned) // Align droneman to top of hitbox
|
||||
switch (dronemanalignment)
|
||||
{
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (middlealigned) // Align droneman to center of hitbox
|
||||
{
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
}
|
||||
else if (bottomoffsetted)
|
||||
{
|
||||
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
case TMDA_BOTTOMOFFSET:
|
||||
default:
|
||||
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||
break;
|
||||
case TMDA_BOTTOM:
|
||||
dronemanoffset = droneboxmandiff;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
break;
|
||||
case TMDA_MIDDLE:
|
||||
dronemanoffset = droneboxmandiff/2;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
break;
|
||||
case TMDA_TOP:
|
||||
dronemanoffset = 0;
|
||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||
break;
|
||||
}
|
||||
|
||||
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
||||
|
@ -12582,9 +12576,9 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
|||
|
||||
// spawn visual elements
|
||||
{
|
||||
mobj_t* goalpost = P_SpawnMobjFromMobj(mobj, 0, 0, goaloffset, MT_NIGHTSDRONE_GOAL);
|
||||
mobj_t* sparkle = P_SpawnMobjFromMobj(mobj, 0, 0, sparkleoffset, MT_NIGHTSDRONE_SPARKLING);
|
||||
mobj_t* droneman = P_SpawnMobjFromMobj(mobj, 0, 0, dronemanoffset, MT_NIGHTSDRONE_MAN);
|
||||
mobj_t *goalpost = P_SpawnMobjFromMobj(mobj, 0, 0, goaloffset, MT_NIGHTSDRONE_GOAL);
|
||||
mobj_t *sparkle = P_SpawnMobjFromMobj(mobj, 0, 0, sparkleoffset, MT_NIGHTSDRONE_SPARKLING);
|
||||
mobj_t *droneman = P_SpawnMobjFromMobj(mobj, 0, 0, dronemanoffset, MT_NIGHTSDRONE_MAN);
|
||||
|
||||
P_SetTarget(&mobj->target, goalpost);
|
||||
P_SetTarget(&goalpost->target, sparkle);
|
||||
|
@ -12600,12 +12594,21 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
|||
|
||||
// Remember position preference for later
|
||||
mobj->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE);
|
||||
if (topaligned)
|
||||
mobj->flags |= MF_SLIDEME;
|
||||
else if (middlealigned)
|
||||
mobj->flags |= MF_GRENADEBOUNCE;
|
||||
else if (!bottomoffsetted)
|
||||
mobj->flags |= MF_SLIDEME|MF_GRENADEBOUNCE;
|
||||
switch (dronemanalignment)
|
||||
{
|
||||
case TMDA_BOTTOMOFFSET:
|
||||
default:
|
||||
mobj->flags |= MF_SLIDEME|MF_GRENADEBOUNCE;
|
||||
break;
|
||||
case TMDA_BOTTOM:
|
||||
break;
|
||||
case TMDA_MIDDLE:
|
||||
mobj->flags |= MF_GRENADEBOUNCE;
|
||||
break;
|
||||
case TMDA_TOP:
|
||||
mobj->flags |= MF_SLIDEME;
|
||||
break;
|
||||
}
|
||||
|
||||
// Remember old Z position and flags for correction detection
|
||||
goalpost->movefactor = mobj->z;
|
||||
|
|
|
@ -5058,6 +5058,19 @@ static void P_ConvertBinaryMap(void)
|
|||
mapthings[i].args[0] = mapthings[i].extrainfo;
|
||||
mapthings[i].args[1] = mapthings[i].options;
|
||||
break;
|
||||
case 1703: //Ideya drone
|
||||
mapthings[i].args[0] = mapthings[i].angle & 0xFFF;
|
||||
mapthings[i].args[1] = mapthings[i].extrainfo*32;
|
||||
mapthings[i].args[2] = ((mapthings[i].angle & 0xF000) >> 12)*32;
|
||||
if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_EXTRA)) == (MTF_OBJECTSPECIAL|MTF_EXTRA))
|
||||
mapthings[i].args[3] = TMDA_BOTTOM;
|
||||
else if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_EXTRA)) == MTF_OBJECTSPECIAL)
|
||||
mapthings[i].args[3] = TMDA_TOP;
|
||||
else if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_EXTRA)) == MTF_EXTRA)
|
||||
mapthings[i].args[3] = TMDA_MIDDLE;
|
||||
else
|
||||
mapthings[i].args[3] = TMDA_BOTTOMOFFSET;
|
||||
break;
|
||||
case 1704: //NiGHTS bumper
|
||||
mapthings[i].pitch = 30 * (((mapthings[i].options & 15) + 9) % 12);
|
||||
mapthings[i].options &= ~0xF;
|
||||
|
|
|
@ -36,6 +36,14 @@ typedef enum
|
|||
TMM_ALWAYSTHINK = 1<<7,
|
||||
} textmapmaceflags_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TMDA_BOTTOMOFFSET = 1,
|
||||
TMDA_BOTTOM = 1<<1,
|
||||
TMDA_MIDDLE = 1<<2,
|
||||
TMDA_TOP = 1<<3,
|
||||
} textmapdronealignment_t;
|
||||
|
||||
//FOF flags
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
@ -706,8 +706,7 @@ static void P_DeNightserizePlayer(player_t *player)
|
|||
|
||||
// If you screwed up, kiss your score and ring bonus goodbye.
|
||||
// But only do this in special stage (and instakill!) In regular stages, wait til we hit the ground.
|
||||
player->marescore = player->spheres =\
|
||||
player->rings = 0;
|
||||
player->marescore = player->spheres = player->rings = 0;
|
||||
}
|
||||
|
||||
// Check to see if the player should be killed.
|
||||
|
@ -717,13 +716,12 @@ static void P_DeNightserizePlayer(player_t *player)
|
|||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
if (!(mo2->type == MT_NIGHTSDRONE))
|
||||
if (mo2->type != MT_NIGHTSDRONE)
|
||||
continue;
|
||||
|
||||
if (mo2->flags2 & MF2_AMBUSH)
|
||||
{
|
||||
player->marescore = player->spheres =\
|
||||
player->rings = 0;
|
||||
player->marescore = player->spheres = player->rings = 0;
|
||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||
|
||||
// Reset music to beginning if MIXNIGHTSCOUNTDOWN
|
||||
|
|
Loading…
Reference in a new issue