mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'demeteor-spikes' into 'master'
De-meteor Spikes See merge request kart-krew-dev/ring-racers-internal!2714
This commit is contained in:
commit
14940276b8
4 changed files with 52 additions and 22 deletions
|
|
@ -5016,7 +5016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
14*FRACUNIT, // height
|
||||
0, // display offset
|
||||
4, // mass
|
||||
0, // damage
|
||||
45*FRACUNIT, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT|MF_PAPERCOLLISION|MF_NOHITLAGFORME|MF_DONTENCOREMAP, // flags
|
||||
S_NULL // raisestate
|
||||
|
|
|
|||
28
src/k_kart.c
28
src/k_kart.c
|
|
@ -1225,6 +1225,20 @@ boolean K_KartSolidBounce(mobj_t *bounceMobj, mobj_t *solidMobj)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (solidMobj->type == MT_WALLSPIKE)
|
||||
{
|
||||
// Always thrust out towards the tip
|
||||
// (...don't try to roll our own bad calculations,
|
||||
// just make this behave like a wallspring...)
|
||||
|
||||
P_DoSpringEx(bounceMobj, mapobjectscale, 0, solidMobj->info->damage,
|
||||
solidMobj->angle, SKINCOLOR_NONE);
|
||||
|
||||
K_PlayerJustBumped(bounceMobj->player);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Adds the OTHER object's momentum times a bunch, for the best chance of getting the correct direction
|
||||
{
|
||||
distx = (bounceMobj->x + solidMobj->momx) - (solidMobj->x + bounceMobj->momx);
|
||||
|
|
@ -1252,16 +1266,6 @@ boolean K_KartSolidBounce(mobj_t *bounceMobj, mobj_t *solidMobj)
|
|||
normalisedx = FixedDiv(distx, dist);
|
||||
normalisedy = FixedDiv(disty, dist);
|
||||
|
||||
if (solidMobj->type == MT_WALLSPIKE)
|
||||
{
|
||||
fixed_t co = FCOS(solidMobj->angle);
|
||||
fixed_t si = FSIN(solidMobj->angle);
|
||||
|
||||
// Always thrust out toward the tip
|
||||
normalisedx = FixedMul(normalisedx, abs(si)) - co;
|
||||
normalisedy = FixedMul(normalisedy, abs(co)) - si;
|
||||
}
|
||||
|
||||
bounceSpeed = FixedHypot(bounceMobj->momx, bounceMobj->momy);
|
||||
bounceSpeed = FixedMul(bounceSpeed, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
||||
bounceSpeed += minBump;
|
||||
|
|
@ -6767,7 +6771,7 @@ void K_DriftDustHandling(mobj_t *spawner)
|
|||
angle_t anglediff;
|
||||
const INT16 spawnrange = spawner->radius >> FRACBITS;
|
||||
|
||||
if (!P_IsObjectOnGround(spawner) || leveltime % 2 != 0)
|
||||
if (!P_IsObjectOnGround(spawner) || leveltime % 2 != 0 || spawner->destscale == 1)
|
||||
return;
|
||||
|
||||
if (spawner->player)
|
||||
|
|
@ -10684,7 +10688,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
|
||||
if (player->tumbleBounces > 0)
|
||||
if (player->tumbleBounces > 0 && player->mo->destscale > 1)
|
||||
{
|
||||
K_HandleTumbleSound(player);
|
||||
if (P_IsObjectOnGround(player->mo) && player->mo->momz * P_MobjFlip(player->mo) <= 0)
|
||||
|
|
|
|||
|
|
@ -2631,6 +2631,7 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
|
|||
// body shrinks into nothingness.
|
||||
player->mo->destscale = 1;
|
||||
player->mo->flags |= MF_NOCLIPTHING;
|
||||
player->tumbleBounces = 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
43
src/p_map.c
43
src/p_map.c
|
|
@ -272,22 +272,22 @@ P_DoSpringEx
|
|||
return;
|
||||
}
|
||||
|
||||
object->eflags |= MFE_SPRUNG; // apply this flag asap!
|
||||
|
||||
if (horizspeed < 0)
|
||||
{
|
||||
horizspeed = -(horizspeed);
|
||||
finalAngle += ANGLE_180;
|
||||
}
|
||||
|
||||
object->standingslope = NULL; // Okay, now we know it's not going to be relevant - no launching off at silly angles for you.
|
||||
object->terrain = NULL;
|
||||
|
||||
object->eflags |= MFE_SPRUNG; // apply this flag asap!
|
||||
|
||||
if ((vertispeed < 0) ^ P_IsObjectFlipped(object))
|
||||
vertispeed *= 2;
|
||||
|
||||
if (vertispeed)
|
||||
{
|
||||
object->standingslope = NULL; // Okay, now we know it's not going to be relevant - no launching off at silly angles for you.
|
||||
object->terrain = NULL;
|
||||
|
||||
if ((vertispeed < 0) ^ P_IsObjectFlipped(object))
|
||||
vertispeed *= 2;
|
||||
|
||||
object->momz = FixedMul(vertispeed, scaleVal);
|
||||
}
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ P_DoSpringEx
|
|||
P_InstaThrust(object, finalAngle, finalSpeed);
|
||||
}
|
||||
|
||||
if (object->player)
|
||||
if (object->player && starcolor != SKINCOLOR_NONE)
|
||||
{
|
||||
K_TumbleInterrupt(object->player);
|
||||
P_ResetPlayer(object->player);
|
||||
|
|
@ -1341,6 +1341,11 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
|||
thing->y,
|
||||
g_tm.thing->z + (P_MobjFlip(thing) > 0 ? g_tm.thing->height : -thing->height)
|
||||
);
|
||||
|
||||
if (g_tm.thing->type == MT_WALLSPIKE)
|
||||
{
|
||||
K_KartSolidBounce(thing, g_tm.thing);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1367,10 +1372,30 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
|||
if (!P_IsObjectOnGround(g_tm.thing) && g_tm.thing->momz * P_MobjFlip(g_tm.thing) < 0) // fell into it
|
||||
{
|
||||
P_DamageMobj(g_tm.thing, thing, thing, 1, DMG_TUMBLE);
|
||||
|
||||
if (thing->type == MT_WALLSPIKE)
|
||||
{
|
||||
K_KartSolidBounce(g_tm.thing, thing);
|
||||
}
|
||||
|
||||
return BMIT_CONTINUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (
|
||||
thing->type == MT_WALLSPIKE
|
||||
&& g_tm.thing->health
|
||||
&& g_tm.thing->player
|
||||
&& (g_tm.thing->player->justbumped < bumptime-2)
|
||||
&& (
|
||||
g_tm.thing->player->flashing
|
||||
|| P_PlayerInPain(g_tm.thing->player)
|
||||
)
|
||||
)
|
||||
{
|
||||
K_StumblePlayer(g_tm.thing->player);
|
||||
}
|
||||
|
||||
// Do not return because solidity code comes below.
|
||||
P_DamageMobj(g_tm.thing, thing, thing, 1, DMG_NORMAL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue