Ironman: splat top/bottom WIP

This commit is contained in:
AJ Martinez 2022-10-31 18:09:02 -07:00
parent b9517d3a89
commit 02bf3bc695
5 changed files with 40 additions and 8 deletions

View file

@ -3283,6 +3283,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_MAGICIANBOX", "S_MAGICIANBOX",
"S_MAGICIANBOXTOP", "S_MAGICIANBOXTOP",
"S_MAGICIANBOXBOTTOM",
// Signpost sparkles // Signpost sparkles
"S_SIGNSPARK1", "S_SIGNSPARK1",

View file

@ -543,6 +543,8 @@ char sprnames[NUMSPRITES + 1][5] =
"INVI", // Invincibility speedlines "INVI", // Invincibility speedlines
"ICAP", // Item capsules "ICAP", // Item capsules
"MGBX", // Heavy Magician transform box "MGBX", // Heavy Magician transform box
"MGBT", // Heavy Magician transform box top
"MGBB", // Heavy Magician transform box bottom
"WIPD", // Wipeout dust trail "WIPD", // Wipeout dust trail
"DRIF", // Drift Sparks "DRIF", // Drift Sparks
@ -3890,7 +3892,8 @@ state_t states[NUMSTATES] =
//{SPR_ICAP, FF_FLOORSPRITE|5, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_INSIDE //{SPR_ICAP, FF_FLOORSPRITE|5, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_INSIDE
{SPR_MGBX, FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX {SPR_MGBX, FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX
{SPR_MGBX, FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX_TOP {SPR_MGBT, FF_FLOORSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX_TOP
{SPR_MGBB, FF_FLOORSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX_BOTTOM
{SPR_SGNS, FF_ADD|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_SIGNSPARK2}, // S_SIGNSPARK1 {SPR_SGNS, FF_ADD|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_SIGNSPARK2}, // S_SIGNSPARK1
{SPR_SGNS, FF_ADD|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_SIGNSPARK3}, // S_SIGNSPARK2 {SPR_SGNS, FF_ADD|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_SIGNSPARK3}, // S_SIGNSPARK2

View file

@ -1089,6 +1089,8 @@ typedef enum sprite
SPR_INVI, // Invincibility speedlines SPR_INVI, // Invincibility speedlines
SPR_ICAP, // Item capsules SPR_ICAP, // Item capsules
SPR_MGBX, // Heavy Magician transform box SPR_MGBX, // Heavy Magician transform box
SPR_MGBT, // Heavy Magician transform box top
SPR_MGBB, // Heavy Magician transform box bottom
SPR_WIPD, // Wipeout dust trail SPR_WIPD, // Wipeout dust trail
SPR_DRIF, // Drift Sparks SPR_DRIF, // Drift Sparks
@ -4295,6 +4297,7 @@ typedef enum state
S_MAGICIANBOX, S_MAGICIANBOX,
S_MAGICIANBOX_TOP, S_MAGICIANBOX_TOP,
S_MAGICIANBOX_BOTTOM,
// Signpost sparkles // Signpost sparkles
S_SIGNSPARK1, S_SIGNSPARK1,

View file

@ -7612,6 +7612,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
case MT_MAGICIANBOX: case MT_MAGICIANBOX:
{ {
fixed_t destx, desty, fakeangle; fixed_t destx, desty, fakeangle;
fixed_t zoff = 0;
INT32 j; INT32 j;
// EV1: rotation rate // EV1: rotation rate
@ -7635,15 +7636,20 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
} }
else if (mobj->extravalue2 == TICRATE/3 && mobj->target) else if (mobj->extravalue2 == TICRATE/3 && mobj->target)
{ {
mobj->target->renderflags &= ~RF_DONTDRAW; mobj->target->renderflags &= ~RF_DONTDRAW;
mobj->momx = mobj->target->momx; mobj->momx = mobj->target->momx;
mobj->momy = mobj->target->momy; mobj->momy = mobj->target->momy;
mobj->momz = mobj->target->momz; mobj->momz = mobj->target->momz;
P_Thrust(mobj, mobj->angle + ANGLE_90, 32*mapobjectscale); if (mobj->state == &states[S_MAGICIANBOX]) // sides
P_Thrust(mobj, mobj->angle + ANGLE_90, 32*mapobjectscale);
mobj->flags &= ~MF_NOGRAVITY; mobj->flags &= ~MF_NOGRAVITY;
mobj->momz += 10*mapobjectscale; mobj->momz += 10*mapobjectscale;
if (mobj->state == &states[S_MAGICIANBOX_BOTTOM])
mobj->momz *= -1;
if (!mobj->cusval) // Some stuff should only occur once per box if (!mobj->cusval) // Some stuff should only occur once per box
return true; return true;
@ -7702,19 +7708,31 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
destx = mobj->target->x; destx = mobj->target->x;
desty = mobj->target->y; desty = mobj->target->y;
fakeangle = (FixedInt(AngleFixed(mobj->angle)) + 90)%360; // What if (mobj->state == &states[S_MAGICIANBOX]) // sides
{
CONS_Printf("side\n");
fakeangle = (FixedInt(AngleFixed(mobj->angle)) + 90)%360; // What
destx += FixedMul(mobj->radius*2, FINECOSINE(FixedAngle(fakeangle*FRACUNIT) >> ANGLETOFINESHIFT)); destx += FixedMul(mobj->radius*2, FINECOSINE(FixedAngle(fakeangle*FRACUNIT) >> ANGLETOFINESHIFT));
desty += FixedMul(mobj->radius*2, FINESINE(FixedAngle(fakeangle*FRACUNIT) >> ANGLETOFINESHIFT)); desty += FixedMul(mobj->radius*2, FINESINE(FixedAngle(fakeangle*FRACUNIT) >> ANGLETOFINESHIFT));
}
else if (mobj->state == &states[S_MAGICIANBOX_TOP]) // top
{
CONS_Printf("top\n");
zoff = mobj->radius*4;
}
else {
CONS_Printf("bottom\n");
}
if (mobj->flags2 & MF2_AMBUSH) if (mobj->flags2 & MF2_AMBUSH)
{ {
P_SetOrigin(mobj, destx, desty, mobj->target->z); P_SetOrigin(mobj, destx, desty, mobj->target->z + zoff);
mobj->flags2 &= ~MF2_AMBUSH; mobj->flags2 &= ~MF2_AMBUSH;
} }
else else
{ {
P_MoveOrigin(mobj, destx, desty, mobj->target->z); P_MoveOrigin(mobj, destx, desty, mobj->target->z + zoff);
} }
break; break;
} }

View file

@ -367,7 +367,7 @@ void SetRandomFakePlayerSkin(player_t* player, boolean fast)
fixed_t baseangle = P_RandomRange(PR_DECORATION, 0, 359); fixed_t baseangle = P_RandomRange(PR_DECORATION, 0, 359);
INT32 j, k; INT32 j, k;
for (k = 0; k < 4; k++) for (k = 0; k < 6; k++)
{ {
mobj_t *box = P_SpawnMobjFromMobj(parent, 0, 0, 0, MT_MAGICIANBOX); mobj_t *box = P_SpawnMobjFromMobj(parent, 0, 0, 0, MT_MAGICIANBOX);
box->target = parent; box->target = parent;
@ -387,6 +387,13 @@ void SetRandomFakePlayerSkin(player_t* player, boolean fast)
box->cusval = 1; // Should play sounds when disappearing box->cusval = 1; // Should play sounds when disappearing
else else
box->cusval = 0; box->cusval = 0;
if (k > 3)
{
P_SetMobjState(box, (k == 4) ? S_MAGICIANBOX_TOP : S_MAGICIANBOX_BOTTOM);
box->renderflags |= RF_NOSPLATBILLBOARD;
box->angle = FixedAngle(baseangle*FRACUNIT);
}
} }
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)