diff --git a/src/deh_tables.c b/src/deh_tables.c index aae6f660c..7e309c33f 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -323,6 +323,7 @@ actionpointer_t actionpointers[] = {{A_SPBChase}, "A_SPBCHASE"}, {{A_SSMineSearch}, "A_SSMINESEARCH"}, {{A_SSMineExplode}, "A_SSMINEEXPLODE"}, + {{A_LandMineExplode}, "A_LANDMINEEXPLODE"}, {{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, {{A_LightningFollowPlayer}, "A_LIGHTNINGFOLLOWPLAYER"}, {{A_FZBoomFlash}, "A_FZBOOMFLASH"}, diff --git a/src/info.c b/src/info.c index 915702380..b4a8a8012 100644 --- a/src/info.c +++ b/src/info.c @@ -4358,7 +4358,7 @@ state_t states[NUMSTATES] = {SPR_KRBM, FF_FULLBRIGHT|9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10 {SPR_LNDM, 0, -1, {NULL}, 0, 0, S_LANDMINE}, // S_LANDMINE - {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_LANDMINE_EXPLODE + {SPR_NULL, 0, 1, {A_LandMineExplode}, 0, 0, S_NULL}, // S_LANDMINE_EXPLODE {SPR_BHOG, 0, 3, {A_PlaySound}, sfx_s1bd, 1, S_BALLHOG2}, // S_BALLHOG1 {SPR_BHOG, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2 diff --git a/src/info.h b/src/info.h index c9998c498..115948905 100644 --- a/src/info.h +++ b/src/info.h @@ -276,6 +276,7 @@ enum actionnum A_SPBCHASE, A_SSMINESEARCH, A_SSMINEEXPLODE, + A_LANDMINEEXPLODE, A_BALLHOGEXPLODE, A_LIGHTNINGFOLLOWPLAYER, A_FZBOOMFLASH, @@ -546,6 +547,8 @@ void A_JawzExplode(); void A_SPBChase(); void A_SSMineSearch(); void A_SSMineExplode(); +void A_LandMineExplode(); +void A_LandMineExplode(); void A_BallhogExplode(); void A_LightningFollowPlayer(); void A_FZBoomFlash(); diff --git a/src/k_kart.c b/src/k_kart.c index 27ab68276..7401b9d4c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3636,14 +3636,9 @@ 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) +// Does the proximity screen flash and quake for explosions +void K_MineFlashScreen(mobj_t *source) { - INT32 i, radius, height; - mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); - mobj_t *dust; - mobj_t *truc; - INT32 speed, speed2; INT32 pnum; player_t *p; @@ -3666,6 +3661,18 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) break; // we can break right now because quakes are global to all split players somehow. } } +} + +// Spawns the purely visual explosion +void K_SpawnMineExplosion(mobj_t *source, UINT8 color) +{ + INT32 i, radius, height; + mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); + mobj_t *dust; + mobj_t *truc; + INT32 speed, speed2; + + K_MineFlashScreen(source); K_MatchGenericExtraFlags(smoldering, source); smoldering->tics = TICRATE*3; diff --git a/src/k_kart.h b/src/k_kart.h index cf2560fe2..dffc1cedf 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -70,6 +70,7 @@ void K_HandleBumperChanges(player_t *player, UINT8 prevBumpers); void K_DestroyBumpers(player_t *player, UINT8 amount); void K_TakeBumpersFromPlayer(player_t *player, player_t *victim, UINT8 amount); 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_MineFlashScreen(mobj_t *source); void K_SpawnMineExplosion(mobj_t *source, UINT8 color); void K_RunFinishLineBeam(void); UINT16 K_DriftSparkColor(player_t *player, INT32 charge); diff --git a/src/p_enemy.c b/src/p_enemy.c index a5280d777..7d4ad7400 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -310,6 +310,7 @@ void A_JawzExplode(mobj_t *actor); void A_SPBChase(mobj_t *actor); void A_SSMineSearch(mobj_t *actor); void A_SSMineExplode(mobj_t *actor); +void A_LandMineExplode(mobj_t *actor); void A_BallhogExplode(mobj_t *actor); void A_LightningFollowPlayer(mobj_t *actor); void A_FZBoomFlash(mobj_t *actor); @@ -14135,6 +14136,63 @@ void A_SSMineExplode(mobj_t *actor) actor->flags2 |= MF2_DEBRIS; // Set this flag to ensure that the explosion won't be effective more than 1 frame. } +void A_LandMineExplode(mobj_t *actor) +{ + + mobj_t *expl; + INT32 colour = SKINCOLOR_KETCHUP; // we spell words properly here + INT32 i; + mobj_t *smoldering; + mobj_t *dust; + + if (LUA_CallAction(A_LANDMINEEXPLODE, actor)) + return; + + // we'll base the explosion "timer" off of some stupid variable like uh... cvmem! + // Yeah let's use cvmem since nobody uses that + + if (actor->target && !P_MobjWasRemoved(actor->target)) + colour = actor->target->color; + + K_MineFlashScreen(actor); + + // Spawn smoke remains: + smoldering = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SMOLDERING); + P_SetScale(smoldering, actor->scale); + smoldering->tics = TICRATE*3; + + // Spawn a ring: + for (i = 0; i < 32; i++) + { + dust = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SMOKE); + P_SetMobjState(dust, S_OPAQUESMOKE1); + dust->angle = (ANGLE_180/16) * i; + P_SetScale(dust, actor->scale); + dust->destscale = actor->scale*4; + dust->scalespeed = actor->scale/4; + P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, actor->scale)); + } + + actor->fuse = actor->tics; // disappear when this state ends. + + // spawn a few physics explosions + for (i = 0; i < 15; i++) + { + expl = P_SpawnMobj(actor->x, actor->y, actor->z + actor->scale, MT_BOOMEXPLODE); + expl->color = colour; + expl->tics = (i+1); + + //K_MatchGenericExtraFlags(expl, actor); + P_SetScale(expl, actor->scale*4); + + expl->momx = P_RandomRange(-3, 3)*actor->scale/2; + expl->momy = P_RandomRange(-3, 3)*actor->scale/2; + + // 100/45 = 2.22 fu/t + expl->momz = ((i+1)*actor->scale*5/2)*P_MobjFlip(expl); + } +} + void A_BallhogExplode(mobj_t *actor) { mobj_t *mo2;