mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'spb-sliptide-disabled-during-switch' into 'master'
SPB Sliptide disabled during "Hot Potato" (Resolves #1596) Closes #1596 See merge request kart-krew-dev/ring-racers-internal!2720
This commit is contained in:
commit
5aa6af4f97
1 changed files with 49 additions and 39 deletions
|
|
@ -202,37 +202,37 @@ static void SpawnSPBSliptide(mobj_t *spb, SINT8 dir)
|
||||||
angle_t travelangle;
|
angle_t travelangle;
|
||||||
fixed_t sz = spb->floorz;
|
fixed_t sz = spb->floorz;
|
||||||
|
|
||||||
if (spb->eflags & MFE_VERTICALFLIP)
|
if (spb->eflags & MFE_VERTICALFLIP)
|
||||||
{
|
{
|
||||||
sz = spb->ceilingz;
|
sz = spb->ceilingz;
|
||||||
|
}
|
||||||
|
|
||||||
|
travelangle = K_MomentumAngle(spb);
|
||||||
|
|
||||||
|
if ((leveltime & 1) && abs(spb->z - sz) < FRACUNIT*64)
|
||||||
|
{
|
||||||
|
newx = P_ReturnThrustX(spb, travelangle - (dir*ANGLE_45), 24*FRACUNIT);
|
||||||
|
newy = P_ReturnThrustY(spb, travelangle - (dir*ANGLE_45), 24*FRACUNIT);
|
||||||
|
|
||||||
|
spark = P_SpawnMobjFromMobj(spb, newx, newy, 0, MT_SPBDUST);
|
||||||
|
spark->z = sz;
|
||||||
|
|
||||||
|
P_SetMobjState(spark, S_KARTAIZDRIFTSTRAT);
|
||||||
|
P_SetTarget(&spark->target, spb);
|
||||||
|
|
||||||
|
spark->colorized = true;
|
||||||
|
spark->color = SKINCOLOR_RED;
|
||||||
|
|
||||||
|
spark->angle = travelangle + (dir * ANGLE_90);
|
||||||
|
P_SetScale(spark, (spark->destscale = spb->scale*3/2));
|
||||||
|
|
||||||
|
spark->momx = (6*spb->momx)/5;
|
||||||
|
spark->momy = (6*spb->momy)/5;
|
||||||
|
|
||||||
|
K_MatchGenericExtraFlags(spark, spb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
travelangle = K_MomentumAngle(spb);
|
|
||||||
|
|
||||||
if ((leveltime & 1) && abs(spb->z - sz) < FRACUNIT*64)
|
|
||||||
{
|
|
||||||
newx = P_ReturnThrustX(spb, travelangle - (dir*ANGLE_45), 24*FRACUNIT);
|
|
||||||
newy = P_ReturnThrustY(spb, travelangle - (dir*ANGLE_45), 24*FRACUNIT);
|
|
||||||
|
|
||||||
spark = P_SpawnMobjFromMobj(spb, newx, newy, 0, MT_SPBDUST);
|
|
||||||
spark->z = sz;
|
|
||||||
|
|
||||||
P_SetMobjState(spark, S_KARTAIZDRIFTSTRAT);
|
|
||||||
P_SetTarget(&spark->target, spb);
|
|
||||||
|
|
||||||
spark->colorized = true;
|
|
||||||
spark->color = SKINCOLOR_RED;
|
|
||||||
|
|
||||||
spark->angle = travelangle + (dir * ANGLE_90);
|
|
||||||
P_SetScale(spark, (spark->destscale = spb->scale*3/2));
|
|
||||||
|
|
||||||
spark->momx = (6*spb->momx)/5;
|
|
||||||
spark->momy = (6*spb->momy)/5;
|
|
||||||
|
|
||||||
K_MatchGenericExtraFlags(spark, spb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Used for seeking and when SPB is trailing its target from way too close!
|
// Used for seeking and when SPB is trailing its target from way too close!
|
||||||
static void SpawnSPBSpeedLines(mobj_t *spb)
|
static void SpawnSPBSpeedLines(mobj_t *spb)
|
||||||
{
|
{
|
||||||
|
|
@ -392,6 +392,7 @@ static void SPBSeek(mobj_t *spb, mobj_t *bestMobj)
|
||||||
// Go past our target and explode instead.
|
// Go past our target and explode instead.
|
||||||
if (spb->fuse == 0)
|
if (spb->fuse == 0)
|
||||||
{
|
{
|
||||||
|
spb_intangible(spb) = SPB_FLASHING;
|
||||||
spb->fuse = 2*TICRATE;
|
spb->fuse = 2*TICRATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -626,16 +627,24 @@ static void SPBSeek(mobj_t *spb, mobj_t *bestMobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sliptide != 0)
|
//CONS_Printf("%d: leveltime %d: SPB intangibility %d: SPBModeTimer\n", leveltime, spb_intangible(spb), spb_modetimer(spb));
|
||||||
{
|
|
||||||
// 1 if turning left, -1 if turning right.
|
// Tired of this thing whacking people when switching targets.
|
||||||
// Angles work counterclockwise, remember!
|
// I'm pretty sure checking mode timer doesn't work but, idk insurance!!
|
||||||
SpawnSPBSliptide(spb, sliptide);
|
|
||||||
}
|
if (spb_intangible(spb) <= 0 || (spb_modetimer(spb) > 0))
|
||||||
else
|
{
|
||||||
{
|
if (sliptide != 0)
|
||||||
// if we're mostly going straight, then spawn the V dust cone!
|
{
|
||||||
SpawnSPBDust(spb);
|
// 1 if turning left, -1 if turning right.
|
||||||
|
// Angles work counterclockwise, remember!
|
||||||
|
SpawnSPBSliptide(spb, sliptide);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// if we're mostly going straight, then spawn the V dust cone!
|
||||||
|
SpawnSPBDust(spb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always spawn speed lines while seeking
|
// Always spawn speed lines while seeking
|
||||||
|
|
@ -1038,6 +1047,7 @@ void Obj_SPBThink(mobj_t *spb)
|
||||||
spb->color = SKINCOLOR_NONE;
|
spb->color = SKINCOLOR_NONE;
|
||||||
spb->colorized = false;
|
spb->colorized = false;
|
||||||
}
|
}
|
||||||
|
spb_intangible(spb) = SPB_FLASHING; // This is supposed to make it intangible when it's about to quit
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clamp within level boundaries.
|
// Clamp within level boundaries.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue