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";
|
sprite = "NDRNA1";
|
||||||
width = 16;
|
width = 16;
|
||||||
height = 56;
|
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
|
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)
|
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
|
goalpost = mobj->target;
|
||||||
mobj_t *goalpost = NULL;
|
if (goalpost->target && goalpost->target->type == MT_NIGHTSDRONE_SPARKLING)
|
||||||
mobj_t *sparkle = NULL;
|
sparkle = goalpost->target;
|
||||||
mobj_t *droneman = NULL;
|
if (goalpost->tracer && goalpost->tracer->type == MT_NIGHTSDRONE_MAN)
|
||||||
|
droneman = goalpost->tracer;
|
||||||
|
}
|
||||||
|
|
||||||
boolean flip = mobj->flags2 & MF2_OBJECTFLIP;
|
if (!goalpost || !sparkle || !droneman)
|
||||||
boolean topaligned = (mobj->flags & MF_SLIDEME) && !(mobj->flags & MF_GRENADEBOUNCE);
|
return;
|
||||||
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;
|
// 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 (topaligned) // Align droneman to top of hitbox
|
||||||
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
|
dronemanoffset = droneboxmandiff;
|
||||||
{
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
dronemanoffset = droneboxmandiff;
|
}
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
else if (middlealigned) // Align droneman to center of hitbox
|
||||||
}
|
{
|
||||||
else if (middlealigned) // Align droneman to center of hitbox
|
dronemanoffset = droneboxmandiff/2;
|
||||||
{
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
dronemanoffset = droneboxmandiff/2;
|
}
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
else if (bottomoffsetted)
|
||||||
}
|
{
|
||||||
else if (bottomoffsetted)
|
dronemanoffset = 24*FRACUNIT;
|
||||||
{
|
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||||
dronemanoffset = 24*FRACUNIT;
|
|
||||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dronemanoffset = 0;
|
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
sparkleoffset = goaloffset - FixedMul(15*FRACUNIT, mobj->scale);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (topaligned) // Align droneman to top of hitbox
|
dronemanoffset = 0;
|
||||||
{
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
P_TeleportMove(goalpost, mobj->x, mobj->y, mobj->z + goaloffset);
|
sparkleoffset = goaloffset - FixedMul(15*FRACUNIT, mobj->scale);
|
||||||
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
|
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);
|
dronemanoffset = 0;
|
||||||
P_TeleportMove(sparkle, mobj->x, mobj->y, sparkle->z);
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
}
|
}
|
||||||
|
else if (middlealigned) // Align droneman to center of hitbox
|
||||||
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");
|
dronemanoffset = droneboxmandiff/2;
|
||||||
if (goalpost && goalpost->state != &states[S_INVISIBLE])
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
P_SetMobjState(goalpost, S_INVISIBLE);
|
|
||||||
if (sparkle && sparkle->state != &states[S_INVISIBLE])
|
|
||||||
P_SetMobjState(sparkle, S_INVISIBLE);
|
|
||||||
}
|
}
|
||||||
}
|
else if (bottomoffsetted)
|
||||||
// Invisible/bouncing mode.
|
|
||||||
else
|
|
||||||
{
|
|
||||||
INT32 i;
|
|
||||||
boolean bonustime = false;
|
|
||||||
fixed_t zcomp;
|
|
||||||
|
|
||||||
// Bouncy bouncy!
|
|
||||||
if (!flip)
|
|
||||||
{
|
{
|
||||||
if (topaligned)
|
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||||
zcomp = droneboxmandiff + mobj->z;
|
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||||
else if (middlealigned)
|
|
||||||
zcomp = (droneboxmandiff/2) + mobj->z;
|
|
||||||
else if (bottomoffsetted)
|
|
||||||
zcomp = mobj->z + FixedMul(24*FRACUNIT, mobj->scale);
|
|
||||||
else
|
|
||||||
zcomp = mobj->z;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (topaligned)
|
dronemanoffset = droneboxmandiff;
|
||||||
zcomp = mobj->z;
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
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;
|
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
||||||
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
|
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++)
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bonustime)
|
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))
|
if (!(droneman->flags2 & MF2_DONTDRAW))
|
||||||
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;
|
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 flip = mthing->options & MTF_OBJECTFLIP;
|
||||||
boolean topaligned = (mthing->options & MTF_OBJECTSPECIAL) && !(mthing->options & MTF_EXTRA);
|
INT16 timelimit = mthing->args[0];
|
||||||
boolean middlealigned = (mthing->options & MTF_EXTRA) && !(mthing->options & MTF_OBJECTSPECIAL);
|
fixed_t hitboxheight = mthing->args[1] << FRACBITS;
|
||||||
boolean bottomoffsetted = !(mthing->options & MTF_OBJECTSPECIAL) && !(mthing->options & MTF_EXTRA);
|
fixed_t hitboxradius = mthing->args[2] << FRACBITS;
|
||||||
|
INT32 dronemanalignment = mthing->args[3];
|
||||||
INT16 timelimit = mthing->angle & 0xFFF;
|
|
||||||
fixed_t hitboxradius = ((mthing->angle & 0xF000) >> 12)*32*FRACUNIT;
|
|
||||||
fixed_t hitboxheight = mthing->extrainfo*32*FRACUNIT;
|
|
||||||
fixed_t oldheight = mobj->height;
|
fixed_t oldheight = mobj->height;
|
||||||
fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff;
|
fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff;
|
||||||
|
|
||||||
|
@ -12528,25 +12522,25 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
||||||
|
|
||||||
if (!flip)
|
if (!flip)
|
||||||
{
|
{
|
||||||
if (topaligned) // Align droneman to top of hitbox
|
switch (dronemanalignment)
|
||||||
{
|
{
|
||||||
dronemanoffset = droneboxmandiff;
|
case TMDA_BOTTOMOFFSET:
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
default:
|
||||||
}
|
dronemanoffset = FixedMul(24*FRACUNIT, mobj->scale);
|
||||||
else if (middlealigned) // Align droneman to center of hitbox
|
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||||
{
|
break;
|
||||||
dronemanoffset = droneboxmandiff/2;
|
case TMDA_BOTTOM:
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
dronemanoffset = 0;
|
||||||
}
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
else if (bottomoffsetted)
|
break;
|
||||||
{
|
case TMDA_MIDDLE:
|
||||||
dronemanoffset = 24*FRACUNIT;
|
dronemanoffset = droneboxmandiff/2;
|
||||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
}
|
break;
|
||||||
else
|
case TMDA_TOP:
|
||||||
{
|
dronemanoffset = droneboxmandiff;
|
||||||
dronemanoffset = 0;
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sparkleoffset = goaloffset - FixedMul(15*FRACUNIT, mobj->scale);
|
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->eflags |= MFE_VERTICALFLIP;
|
||||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||||
|
|
||||||
if (topaligned) // Align droneman to top of hitbox
|
switch (dronemanalignment)
|
||||||
{
|
{
|
||||||
dronemanoffset = 0;
|
case TMDA_BOTTOMOFFSET:
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
default:
|
||||||
}
|
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
||||||
else if (middlealigned) // Align droneman to center of hitbox
|
goaloffset = dronemangoaldiff + dronemanoffset;
|
||||||
{
|
break;
|
||||||
dronemanoffset = droneboxmandiff/2;
|
case TMDA_BOTTOM:
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
dronemanoffset = droneboxmandiff;
|
||||||
}
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
else if (bottomoffsetted)
|
break;
|
||||||
{
|
case TMDA_MIDDLE:
|
||||||
dronemanoffset = droneboxmandiff - FixedMul(24*FRACUNIT, mobj->scale);
|
dronemanoffset = droneboxmandiff/2;
|
||||||
goaloffset = dronemangoaldiff + dronemanoffset;
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
}
|
break;
|
||||||
else
|
case TMDA_TOP:
|
||||||
{
|
dronemanoffset = 0;
|
||||||
dronemanoffset = droneboxmandiff;
|
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
||||||
goaloffset = dronemangoaldiff/2 + dronemanoffset;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
||||||
|
@ -12582,9 +12576,9 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
||||||
|
|
||||||
// spawn visual elements
|
// spawn visual elements
|
||||||
{
|
{
|
||||||
mobj_t* goalpost = P_SpawnMobjFromMobj(mobj, 0, 0, goaloffset, MT_NIGHTSDRONE_GOAL);
|
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 *sparkle = P_SpawnMobjFromMobj(mobj, 0, 0, sparkleoffset, MT_NIGHTSDRONE_SPARKLING);
|
||||||
mobj_t* droneman = P_SpawnMobjFromMobj(mobj, 0, 0, dronemanoffset, MT_NIGHTSDRONE_MAN);
|
mobj_t *droneman = P_SpawnMobjFromMobj(mobj, 0, 0, dronemanoffset, MT_NIGHTSDRONE_MAN);
|
||||||
|
|
||||||
P_SetTarget(&mobj->target, goalpost);
|
P_SetTarget(&mobj->target, goalpost);
|
||||||
P_SetTarget(&goalpost->target, sparkle);
|
P_SetTarget(&goalpost->target, sparkle);
|
||||||
|
@ -12600,12 +12594,21 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
||||||
|
|
||||||
// Remember position preference for later
|
// Remember position preference for later
|
||||||
mobj->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE);
|
mobj->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE);
|
||||||
if (topaligned)
|
switch (dronemanalignment)
|
||||||
mobj->flags |= MF_SLIDEME;
|
{
|
||||||
else if (middlealigned)
|
case TMDA_BOTTOMOFFSET:
|
||||||
mobj->flags |= MF_GRENADEBOUNCE;
|
default:
|
||||||
else if (!bottomoffsetted)
|
mobj->flags |= MF_SLIDEME|MF_GRENADEBOUNCE;
|
||||||
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
|
// Remember old Z position and flags for correction detection
|
||||||
goalpost->movefactor = mobj->z;
|
goalpost->movefactor = mobj->z;
|
||||||
|
|
|
@ -5058,6 +5058,19 @@ static void P_ConvertBinaryMap(void)
|
||||||
mapthings[i].args[0] = mapthings[i].extrainfo;
|
mapthings[i].args[0] = mapthings[i].extrainfo;
|
||||||
mapthings[i].args[1] = mapthings[i].options;
|
mapthings[i].args[1] = mapthings[i].options;
|
||||||
break;
|
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
|
case 1704: //NiGHTS bumper
|
||||||
mapthings[i].pitch = 30 * (((mapthings[i].options & 15) + 9) % 12);
|
mapthings[i].pitch = 30 * (((mapthings[i].options & 15) + 9) % 12);
|
||||||
mapthings[i].options &= ~0xF;
|
mapthings[i].options &= ~0xF;
|
||||||
|
|
|
@ -36,6 +36,14 @@ typedef enum
|
||||||
TMM_ALWAYSTHINK = 1<<7,
|
TMM_ALWAYSTHINK = 1<<7,
|
||||||
} textmapmaceflags_t;
|
} textmapmaceflags_t;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TMDA_BOTTOMOFFSET = 1,
|
||||||
|
TMDA_BOTTOM = 1<<1,
|
||||||
|
TMDA_MIDDLE = 1<<2,
|
||||||
|
TMDA_TOP = 1<<3,
|
||||||
|
} textmapdronealignment_t;
|
||||||
|
|
||||||
//FOF flags
|
//FOF flags
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -706,8 +706,7 @@ static void P_DeNightserizePlayer(player_t *player)
|
||||||
|
|
||||||
// If you screwed up, kiss your score and ring bonus goodbye.
|
// 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.
|
// But only do this in special stage (and instakill!) In regular stages, wait til we hit the ground.
|
||||||
player->marescore = player->spheres =\
|
player->marescore = player->spheres = player->rings = 0;
|
||||||
player->rings = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if the player should be killed.
|
// Check to see if the player should be killed.
|
||||||
|
@ -717,13 +716,12 @@ static void P_DeNightserizePlayer(player_t *player)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mo2 = (mobj_t *)th;
|
mo2 = (mobj_t *)th;
|
||||||
if (!(mo2->type == MT_NIGHTSDRONE))
|
if (mo2->type != MT_NIGHTSDRONE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mo2->flags2 & MF2_AMBUSH)
|
if (mo2->flags2 & MF2_AMBUSH)
|
||||||
{
|
{
|
||||||
player->marescore = player->spheres =\
|
player->marescore = player->spheres = player->rings = 0;
|
||||||
player->rings = 0;
|
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||||
|
|
||||||
// Reset music to beginning if MIXNIGHTSCOUNTDOWN
|
// Reset music to beginning if MIXNIGHTSCOUNTDOWN
|
||||||
|
|
Loading…
Reference in a new issue