SPB knockback is more punishing

Hopefully to prevent instances like the Megablock video, where SPB double-dips just because the 1st one wasn't enough but another is overkill
This commit is contained in:
TehRealSalt 2018-10-18 20:49:30 -04:00
parent 7556cca505
commit f8fc6862b5
6 changed files with 17 additions and 7 deletions

View file

@ -1918,7 +1918,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
return;
}
void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we just throw the player up higher here and extend their spinout timer
void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A bit of a hack, we just throw the player up higher here and extend their spinout timer
{
UINT8 scoremultiply = 1;
if (G_BattleGametype())
@ -1992,6 +1992,12 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
player->powers[pw_flashing] = K_GetKartFlashing(player);
if (inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1)
{
player->kartstuff[k_spinouttimer] = (3*player->kartstuff[k_spinouttimer])/2;
player->mo->momz *= 2;
}
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);

View file

@ -28,7 +28,7 @@ void K_KartPlayerAfterThink(player_t *player);
void K_DoInstashield(player_t *player);
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem);
void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor);
void K_StealBumper(player_t *player, player_t *victim, boolean force);
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);

View file

@ -2136,12 +2136,15 @@ static int lib_kExplodePlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
mobj_t *inflictor = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
if (!source)
return LUA_ErrInvalid(L, "mobj_t");
K_ExplodePlayer(player, source);
if (!inflictor)
return LUA_ErrInvalid(L, "mobj_t");
K_ExplodePlayer(player, source, inflictor);
return 0;
}

View file

@ -4015,7 +4015,7 @@ static inline boolean PIT_MineExplode(mobj_t *thing)
grenade->flags2 |= MF2_DEBRIS;
if (thing->player) // Looks like we're going to have to need a seperate function for this too
K_ExplodePlayer(thing->player, grenade->target);
K_ExplodePlayer(thing->player, grenade->target, grenade);
else
P_DamageMobj(thing, grenade, grenade->target, 1);

View file

@ -516,7 +516,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_ExplodePlayer(player, special->target);
K_ExplodePlayer(player, special->target, special);
}
}
else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, 1))
@ -607,6 +607,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
spbexplode = P_SpawnMobj(toucher->x, toucher->y, toucher->z, MT_SPBEXPLOSION);
spbexplode->extravalue1 = 1; // Tell K_ExplodePlayer to use extra knockback
P_SetTarget(&spbexplode->target, special->target);
P_RemoveMobj(special);

View file

@ -824,7 +824,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->type == MT_PLAYER && thing->player)
{
if (tmthing->state == &states[S_MINEEXPLOSION1])
K_ExplodePlayer(thing->player, tmthing->target);
K_ExplodePlayer(thing->player, tmthing->target, tmthing);
else
K_SpinPlayer(thing->player, tmthing->target, 0, false);
}
@ -1033,7 +1033,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
// Player Damage
if (thing->state == &states[S_MINEEXPLOSION1])
K_ExplodePlayer(tmthing->player, thing->target);
K_ExplodePlayer(tmthing->player, thing->target, thing);
else
K_SpinPlayer(tmthing->player, thing->target, 0, false);