diff --git a/src/k_kart.c b/src/k_kart.c index 8ce427c5..34d34ae0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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); diff --git a/src/k_kart.h b/src/k_kart.h index 7cab42a5..74df0dda 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -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); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 240db71c..239fb101 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -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; } diff --git a/src/p_enemy.c b/src/p_enemy.c index 2a7dd9f9..9c5272d0 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -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); diff --git a/src/p_inter.c b/src/p_inter.c index 27845a8b..43b6ac66 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -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); diff --git a/src/p_map.c b/src/p_map.c index 468a5c67..6371c9ed 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -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);