diff --git a/src/doomstat.h b/src/doomstat.h index 80a351d22..e963001e7 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -514,6 +514,7 @@ extern tic_t mapreset; extern boolean thwompsactive; extern SINT8 spbplace; +extern tic_t bombflashtimer; // Used to avoid causing seizures if multiple mines explode close to you :) extern boolean legitimateexit; extern boolean comebackshowninfo; extern tic_t curlap, bestlap; diff --git a/src/g_game.c b/src/g_game.c index 5f369f715..6e21f48d7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -289,6 +289,7 @@ boolean thwompsactive; // Thwomps activate on lap 2 SINT8 spbplace; // SPB exists, give the person behind better items // Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players) +tic_t bombflashtimer = 0; // Cooldown before another FlashPal can be intialized by a bomb exploding near a displayplayer. Avoids seizures. boolean legitimateexit; // Did this client actually finish the match? boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message? tic_t curlap; // Current lap time diff --git a/src/k_kart.c b/src/k_kart.c index c046b2c49..c1b3816a5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2787,10 +2787,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b K_PlayPainSound(player->mo); if (P_IsDisplayPlayer(player)) - { - quake.intensity = 64*FRACUNIT; - quake.time = 5; - } + P_StartQuake(64<kartstuff[k_instashield] = 15; K_DropItems(player); @@ -2954,6 +2951,8 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 } } +#define MINEQUAKEDIST 4096 + // Spawns the purely visual explosion void K_SpawnMineExplosion(mobj_t *source, UINT8 color) { @@ -2962,6 +2961,28 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) mobj_t *dust; mobj_t *truc; INT32 speed, speed2; + INT32 pnum; + player_t *p; + + // check for potential display players near the source so we can have a sick earthquake / flashpal. + for (pnum = 0; pnum < MAXPLAYERS; pnum++) + { + p = &players[pnum]; + + if (!playeringame[pnum] || !P_IsDisplayPlayer(p)) + continue; + + if (R_PointToDist2(p->mo->x, p->mo->y, source->x, source->y) < mapobjectscale*MINEQUAKEDIST) + { + P_StartQuake(55<mo, source)) + { + bombflashtimer = TICRATE*2; + P_FlashPal(p, 1, 1); + } + break; // we can break right now because quakes are global to all split players somehow. + } + } K_MatchGenericExtraFlags(smoldering, source); smoldering->tics = TICRATE*3; @@ -3032,6 +3053,8 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) } } +#undef MINEQUAKEDIST + static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, INT32 flags2, fixed_t speed) { mobj_t *th; @@ -4874,7 +4897,7 @@ static void K_MoveHeldObjects(player_t *player) if (cur->type == MT_EGGMANITEM_SHIELD) { // Decided that this should use their "canon" color. - cur->color = SKINCOLOR_BLACK; + cur->color = SKINCOLOR_BLACK; } cur->flags &= ~MF_NOCLIPTHING; @@ -5243,7 +5266,7 @@ static void K_UpdateInvincibilitySounds(player_t *player) { if (player->kartstuff[k_invincibilitytimer] > 0) // Prioritize invincibility sfxnum = sfx_alarmi; - else if (player->kartstuff[k_growshrinktimer] > 0) + else if (player->kartstuff[k_growshrinktimer] > 0) sfxnum = sfx_alarmg; } else diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 27f2ad287..15eba4136 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1519,8 +1519,7 @@ static int lib_pStartQuake(lua_State *L) quake.radius = luaL_optinteger(L, 4, 512*FRACUNIT); // These things are actually used in 2.1. - quake.intensity = q_intensity; - quake.time = q_time; + P_StartQuake(q_intensity, q_time); return 0; } diff --git a/src/p_inter.c b/src/p_inter.c index ac1686bcc..0492c25af 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -638,7 +638,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_SetTarget(&special->tracer, toucher); toucher->flags |= MF_NOGRAVITY; toucher->momz = (8*toucher->scale) * P_MobjFlip(toucher); - S_StartSound(toucher, sfx_s1b2); + S_StartSound(toucher, sfx_s1b2); return; // ***************************************** // @@ -3192,10 +3192,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da K_KartPainEnergyFling(player); if (P_IsDisplayPlayer(player)) - { - quake.intensity = 32*FRACUNIT; - quake.time = 5; - } + P_StartQuake(32<>1;