SHOOT bubbles forward

This commit is contained in:
TehRealSalt 2019-05-22 19:26:43 -04:00
parent f615ff3b6b
commit bb794ffac9
4 changed files with 110 additions and 40 deletions

View file

@ -16059,14 +16059,14 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
8, // speed
128*FRACUNIT, // speed
28*FRACUNIT, // radius
56*FRACUNIT, // height
1, // display offset
2, // display offset
16, // mass
0, // damage
sfx_None, // activesound
MF_SPECIAL|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
MF_SPECIAL|MF_BOUNCE|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},

View file

@ -1526,7 +1526,10 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
}
// Do the bump fx when we've CONFIRMED we can bump.
S_StartSound(mobj1, sfx_s3k49);
if ((mobj1->player && mobj1->player->kartstuff[k_itemtype] == KITEM_BUBBLESHIELD) || (mobj2->player && mobj2->player->kartstuff[k_itemtype] == KITEM_BUBBLESHIELD))
S_StartSound(mobj1, sfx_s3k44);
else
S_StartSound(mobj1, sfx_s3k49);
fx = P_SpawnMobj(mobj1->x/2 + mobj2->x/2, mobj1->y/2 + mobj2->y/2, mobj1->z/2 + mobj2->z/2, MT_BUMP);
if (mobj1->eflags & MFE_VERTICALFLIP)
@ -3201,16 +3204,25 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
case MT_SPB:
th->movefactor = finalspeed;
break;
case MT_BUBBLESHIELDTRAP:
P_SetScale(th, ((5*th->destscale)>>2)*4);
th->destscale = (5*th->destscale)>>2;
S_StartSound(th, sfx_s3kbfl);
S_StartSound(th, sfx_cdfm35);
break;
default:
break;
}
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
y = y + P_ReturnThrustY(source, an, source->radius + th->radius);
throwmo = P_SpawnMobj(x, y, z, MT_FIREDITEM);
throwmo->movecount = 1;
throwmo->movedir = source->angle - an;
P_SetTarget(&throwmo->target, source);
if (type != MT_BUBBLESHIELDTRAP)
{
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
y = y + P_ReturnThrustY(source, an, source->radius + th->radius);
throwmo = P_SpawnMobj(x, y, z, MT_FIREDITEM);
throwmo->movecount = 1;
throwmo->movedir = source->angle - an;
P_SetTarget(&throwmo->target, source);
}
return NULL;
}
@ -3769,8 +3781,16 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
{
mobj_t *lasttrail = K_FindLastTrailMobj(player);
if (lasttrail)
if (mapthing == MT_BUBBLESHIELDTRAP) // Drop directly on top of you.
{
newangle = player->mo->angle;
newx = player->mo->x + player->mo->momx;
newy = player->mo->y + player->mo->momy;
newz = player->mo->z;
}
else if (lasttrail)
{
newangle = lasttrail->angle;
newx = lasttrail->x;
newy = lasttrail->y;
newz = lasttrail->z;
@ -3822,6 +3842,12 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
if (mapthing == MT_SSMINE)
mo->extravalue1 = 49; // Pads the start-up length from 21 frames to a full 2 seconds
else if (mapthing == MT_BUBBLESHIELDTRAP)
{
P_SetScale(mo, ((5*mo->destscale)>>2)*4);
mo->destscale = (5*mo->destscale)>>2;
S_StartSound(mo, sfx_s3kbfl);
}
}
}
@ -6481,16 +6507,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player->kartstuff[k_bubbleblowup] == 0)
S_StartSound(player->mo, sfx_s3k75);
player->kartstuff[k_bubbleblowup]++;
player->kartstuff[k_bubblecool] = TICRATE+bubbletime;
player->kartstuff[k_bubblecool] = player->kartstuff[k_bubbleblowup]*3;
if (player->kartstuff[k_bubbleblowup] > bubbletime)
{
mobj_t *trap = P_SpawnMobj(player->mo->x + player->mo->momx, player->mo->y + player->mo->momy, player->mo->z + player->mo->momz, MT_BUBBLESHIELDTRAP);
P_SetScale(trap, ((5*trap->destscale)>>2)*4);
trap->destscale = (5*trap->destscale)>>2;
P_SetTarget(&trap->target, player->mo);
trap->threshold = TICRATE;
S_StartSound(trap, sfx_s3kbfl);
K_ThrowKartItem(player, (player->kartstuff[k_throwdir] > 0), MT_BUBBLESHIELDTRAP, -1, 0);
K_PlayAttackTaunt(player->mo);
player->kartstuff[k_bubbleblowup] = 0;
player->kartstuff[k_itemamount]--;

View file

@ -689,20 +689,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (!player->mo || player->spectator)
return;
// kill
/*if (player->kartstuff[k_invincibilitytimer] > 0
|| player->kartstuff[k_growshrinktimer] > 0
|| player->kartstuff[k_flamedash] > 0)
{
P_KillMobj(special, toucher, toucher);
return;
}*/
// no interaction
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_hyudorotimer] > 0
|| player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0)
return;
// attach to player!
P_SetTarget(&special->tracer, toucher);
toucher->flags |= MF_NOGRAVITY;

View file

@ -1729,6 +1729,10 @@ void P_XYMovement(mobj_t *mo)
P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT);
}
}
// Bubble bounce
if (mo->type == MT_BUBBLESHIELDTRAP)
S_StartSound(mo, sfx_s3k44);
//}
// Bounce ring algorithm
@ -1937,7 +1941,9 @@ void P_XYMovement(mobj_t *mo)
#endif
//{ SRB2kart stuff
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer))
if (mo->type == MT_FLINGRING
|| mo->type == MT_ORBINAUT || mo->type == MT_JAWZ || mo->type == MT_JAWZ_DUD
|| mo->type == MT_BALLHOG || mo->type == MT_BUBBLESHIELDTRAP)
return;
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2)
@ -2274,6 +2280,7 @@ static boolean P_ZMovement(mobj_t *mo)
case MT_JAWZ_DUD:
case MT_BALLHOG:
case MT_SSMINE:
case MT_BUBBLESHIELDTRAP:
// Remove stuff from death pits.
if (P_CheckDeathPitCollide(mo))
{
@ -8472,11 +8479,11 @@ void P_MobjThinker(mobj_t *mobj)
wave->flags &= ~(MF_NOCLIPHEIGHT|MF_NOGRAVITY);
P_SetScale(wave, (wave->destscale = ws));
P_SetMobjState(wave, S_BUBBLESHIELDWAVE1);
wave->momx = mobj->target->momx;
wave->momy = mobj->target->momy;
wave->momz = mobj->target->momz;
P_SetMobjState(wave, S_BUBBLESHIELDWAVE1);
}
}
}
@ -9279,8 +9286,8 @@ void P_MobjThinker(mobj_t *mobj)
mobj->momz = 0;
mobj->destscale = ((5*mobj->tracer->scale)>>2) + (mobj->tracer->scale>>3);
mobj->tracer->momx = (127*mobj->tracer->momx)/128;
mobj->tracer->momy = (127*mobj->tracer->momy)/128;
mobj->tracer->momx = (63*mobj->tracer->momx)/64;
mobj->tracer->momy = (63*mobj->tracer->momy)/64;
mobj->tracer->momz = (8*mobj->tracer->scale) * P_MobjFlip(mobj->tracer);
if (mobj->movecount > 8*TICRATE)
@ -9314,16 +9321,73 @@ void P_MobjThinker(mobj_t *mobj)
}
else if (mobj->extravalue1) // lost your player somehow, DIE
{
mobj->tracer->flags &= ~MF_NOGRAVITY;
P_KillMobj(mobj, NULL, NULL);
break;
}
else
{
mobj->momz = -(FRACUNIT * P_MobjFlip(mobj));
mobj->destscale = (5*mapobjectscale)>>2;
if (mobj->threshold > 0)
mobj->threshold--;
if (abs(mobj->momx) < 8*mobj->destscale && abs(mobj->momy) < 8*mobj->destscale)
{
// Stop, give light gravity
mobj->momx = mobj->momy = 0;
mobj->momz = -(mobj->scale * P_MobjFlip(mobj));
}
else
{
UINT8 i;
mobj_t *ghost = P_SpawnGhostMobj(mobj);
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
ghost->color = mobj->target->player->skincolor;
ghost->colorized = true;
}
mobj->momx = (23*mobj->momx)/24;
mobj->momy = (23*mobj->momy)/24;
mobj->angle = R_PointToAngle2(0,0,mobj->momx,mobj->momy);
if ((mobj->z - mobj->floorz) < (24*mobj->scale) && (leveltime % 3 != 0))
{
// Cool wave effects!
for (i = 0; i < 2; i++)
{
angle_t aoff;
SINT8 sign = 1;
mobj_t *wave;
if (i & 1)
sign = -1;
else
sign = 1;
aoff = (mobj->angle + ANGLE_180) + (ANGLE_45 * sign);
wave = P_SpawnMobj(mobj->x + FixedMul(mobj->radius, FINECOSINE(aoff>>ANGLETOFINESHIFT)),
mobj->y + FixedMul(mobj->radius, FINESINE(aoff>>ANGLETOFINESHIFT)),
mobj->z, MT_THOK);
wave->flags &= ~(MF_NOCLIPHEIGHT|MF_NOGRAVITY);
P_SetScale(wave, (wave->destscale = mobj->scale/2));
P_SetMobjState(wave, S_BUBBLESHIELDWAVE1);
if (leveltime & 1)
wave->tics++;
P_SetTarget(&wave->target, mobj);
wave->angle = mobj->angle - (ANGLE_90 * sign); // point completely perpendicular from the bubble
K_FlipFromObject(wave, mobj);
P_Thrust(wave, wave->angle, 4*mobj->scale);
}
}
}
}
break;
case MT_KARMAFIREWORK: