New bomb explosion effect

This commit is contained in:
Sryder13 2018-02-05 22:53:31 +00:00
parent d41d5800eb
commit c52475a630
7 changed files with 244 additions and 6 deletions

View file

@ -6363,6 +6363,29 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_BOMBEXPLOSION1",
"S_BOMBEXPLOSION2",
// New explosion
"S_QUICKBOOM1",
"S_QUICKBOOM2",
"S_QUICKBOOM3",
"S_QUICKBOOM4",
"S_QUICKBOOM5",
"S_QUICKBOOM6",
"S_QUICKBOOM7",
"S_QUICKBOOM8",
"S_QUICKBOOM9",
"S_QUICKBOOM10",
"S_SLOWBOOM1",
"S_SLOWBOOM2",
"S_SLOWBOOM3",
"S_SLOWBOOM4",
"S_SLOWBOOM5",
"S_SLOWBOOM6",
"S_SLOWBOOM7",
"S_SLOWBOOM8",
"S_SLOWBOOM9",
"S_SLOWBOOM10",
// Blue Shell - Blue Lightning for now...
"S_BLUELIGHTNING1",
"S_BLUELIGHTNING2",
@ -6993,6 +7016,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_BOMBEXPLOSION",
"MT_BOMBEXPLOSIONSOUND",
"MT_SMOLDERING", // New explosion
"MT_BOOMPARTICLE",
"MT_BLUELIGHTNING", // Lightning stuff
"MT_BLUEEXPLOSION",
"MT_LIGHTNING",

View file

@ -56,9 +56,10 @@ char sprnames[NUMSPRITES + 1][5] =
"SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
//SRB2kart Sprites
"SPRG","BSPR","RNDM","RPOP","KFRE","DRIF","DSMO","FITM","DFAK","BANA",
"DBAN","GSHE","DGSH","RSHE","DRSH","BOMB","BLIG","LIGH","SINK","SITR",
"KBLN","LAKI","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB",
"CHOM","SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","PBOM"
"DBAN","GSHE","DGSH","RSHE","DRSH","BOMB","KRBM","BLIG","LIGH","SINK",
"SITR","KBLN","LAKI","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS",
"BUZB","CHOM","SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO",
"PBOM"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -2687,8 +2688,30 @@ state_t states[NUMSTATES] =
{SPR_BOMB, 0, 1, {A_GrenadeRing}, 0, 0, S_BOMBITEM}, // S_BOMBITEM
{SPR_BOMB, 0, 1, {NULL}, 0, 0, S_BOMBAIR}, // S_BOMBAIR
{SPR_BOMB, 0, 1, {A_BobombExplode}, MT_BOMBEXPLOSION, 0, S_NULL}, // S_BOMBEXPLODE
{SPR_BOM2, FF_FULLBRIGHT, 6, {NULL}, 0, 0, S_BOMBEXPLOSION2}, // S_BOMBEXPLOSION1
{SPR_BOM2, FF_FULLBRIGHT|1, 22, {A_ForceStop}, 0, 0, S_NULL}, // S_BOMBEXPLOSION2
{SPR_NULL, 0, 6, {NULL}, 0, 0, S_BOMBEXPLOSION2}, // S_BOMBEXPLOSION1
{SPR_NULL, 1, 22, {A_ForceStop}, 0, 0, S_NULL}, // S_BOMBEXPLOSION2
{SPR_KRBM, 0, 1, {NULL}, 0, 0, S_QUICKBOOM2}, // S_QUICKBOOM1
{SPR_KRBM, 1, 1, {NULL}, 0, 0, S_QUICKBOOM3}, // S_QUICKBOOM2
{SPR_KRBM, 2, 1, {NULL}, 0, 0, S_QUICKBOOM4}, // S_QUICKBOOM3
{SPR_KRBM, 3, 1, {NULL}, 0, 0, S_QUICKBOOM5}, // S_QUICKBOOM4
{SPR_KRBM, 4, 1, {NULL}, 0, 0, S_QUICKBOOM6}, // S_QUICKBOOM5
{SPR_KRBM, 5, 1, {NULL}, 0, 0, S_QUICKBOOM7}, // S_QUICKBOOM6
{SPR_KRBM, 6, 1, {NULL}, 0, 0, S_QUICKBOOM8}, // S_QUICKBOOM7
{SPR_KRBM, 7, 2, {NULL}, 0, 0, S_QUICKBOOM9}, // S_QUICKBOOM8
{SPR_KRBM, 8, 2, {NULL}, 0, 0, S_QUICKBOOM10}, // S_QUICKBOOM9
{SPR_KRBM, 9, 2, {NULL}, 0, 0, S_NULL}, // S_QUICKBOOM10
{SPR_KRBM, 0, 3, {NULL}, 0, 0, S_SLOWBOOM2}, // S_SLOWBOOM1
{SPR_KRBM, 1, 3, {NULL}, 0, 0, S_SLOWBOOM3}, // S_SLOWBOOM2
{SPR_KRBM, 2, 3, {NULL}, 0, 0, S_SLOWBOOM4}, // S_SLOWKBOOM3
{SPR_KRBM, 3, 3, {NULL}, 0, 0, S_SLOWBOOM5}, // S_SLOWBOOM4
{SPR_KRBM, 4, 3, {NULL}, 0, 0, S_SLOWBOOM6}, // S_SLOWBOOM5
{SPR_KRBM, 5, 3, {NULL}, 0, 0, S_SLOWBOOM7}, // S_SLOWBOOM6
{SPR_KRBM, 6, 3, {NULL}, 0, 0, S_SLOWBOOM8}, // S_SLOWBOOM7
{SPR_KRBM, 7, 5, {NULL}, 0, 0, S_SLOWBOOM9}, // S_SLOWBOOM8
{SPR_KRBM, 8, 5, {NULL}, 0, 0, S_SLOWBOOM10}, // S_SLOWBOOM9
{SPR_KRBM, 9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10
{SPR_BLIG, 0, 2, {NULL}, 0, 0, S_BLUELIGHTNING2}, // S_BLUELIGHTNING1
{SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2
@ -15006,6 +15029,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_SMOLDERING
-1, // doomednum
S_INVISIBLE, // spawnstate
1, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
35*FRACUNIT, // radius
70*FRACUNIT, // height
0, // display offset
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_SCENERY, // flags
S_NULL // raisestate
},
{ // MT_BOOMPARTICLE
-1, // doomednum
S_INVISIBLE, // spawnstate
1, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_BOUNCE|MF_SCENERY, // flags
S_NULL // raisestate
},
{ // MT_BLUELIGHTNING
-1, // doomednum
S_BLUELIGHTNING1, // spawnstate

View file

@ -594,6 +594,7 @@ typedef enum sprite
SPR_RSHE, // Red Shell
SPR_DRSH, // Dead Red Shell
SPR_BOMB, // Bob-omb
SPR_KRBM,
SPR_BLIG, // Blue Lightning
SPR_LIGH, // Lightning
SPR_SINK, // Kitchen Sink
@ -3200,6 +3201,29 @@ typedef enum state
S_BOMBEXPLOSION1,
S_BOMBEXPLOSION2,
// New explosion
S_QUICKBOOM1,
S_QUICKBOOM2,
S_QUICKBOOM3,
S_QUICKBOOM4,
S_QUICKBOOM5,
S_QUICKBOOM6,
S_QUICKBOOM7,
S_QUICKBOOM8,
S_QUICKBOOM9,
S_QUICKBOOM10,
S_SLOWBOOM1,
S_SLOWBOOM2,
S_SLOWBOOM3,
S_SLOWBOOM4,
S_SLOWBOOM5,
S_SLOWBOOM6,
S_SLOWBOOM7,
S_SLOWBOOM8,
S_SLOWBOOM9,
S_SLOWBOOM10,
// Blue Shell - Blue Lightning for now...
S_BLUELIGHTNING1,
S_BLUELIGHTNING2,
@ -3974,6 +3998,9 @@ typedef enum mobj_type
MT_BOMBEXPLOSION,
MT_BOMBEXPLOSIONSOUND,
MT_SMOLDERING, // New explosion
MT_BOOMPARTICLE,
MT_BLUELIGHTNING, // Lightning stuff
MT_BLUEEXPLOSION,
MT_LIGHTNING,

View file

@ -2087,6 +2087,7 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force)
}
// source is the mobj that originally threw the bomb that exploded etc.
// Spawns the sphere around the explosion that handles spinout
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)
{
mobj_t *mobj;
@ -2169,6 +2170,67 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
}
}
// Spawns the purely visual explosion
void K_SpawnBobombExplosion(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;
smoldering->tics = TICRATE*3;
INT32 speed, speed2;
radius = source->radius>>FRACBITS;
height = source->height>>FRACBITS;
for (i = 0; i < 32; i++)
{
dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE);
dust->angle = ANGLE_90 + ANG1*(11*(i-1));
dust->scale = source->scale;
dust->destscale = source->scale*10;
P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale));
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
source->y + P_RandomRange(-radius, radius)*FRACUNIT,
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOSSEXPLODE);
truc->scale = source->scale*2;
truc->destscale = source->scale*6;
P_SetMobjState(truc, S_SLOWBOOM1);
speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS;
truc->momz = P_RandomRange(-speed, speed)*FRACUNIT;
}
for (i = 0; i < 16; i++)
{
dust = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
source->y + P_RandomRange(-radius, radius)*FRACUNIT,
source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE);
dust->scale = source->scale;
dust->destscale = source->scale*10;
dust->tics = 30;
dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT;
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
source->y + P_RandomRange(-radius, radius)*FRACUNIT,
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE);
truc->scale = source->scale;
truc->destscale = source->scale*5;
speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
speed = FixedMul(15*FRACUNIT, source->scale)>>FRACBITS;
speed2 = FixedMul(45*FRACUNIT, source->scale)>>FRACBITS;
truc->momz = P_RandomRange(speed, speed2)*FRACUNIT;
if (P_RandomChance(FRACUNIT/2))
truc->momz = -truc->momz;
truc->tics = TICRATE*2;
}
}
static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle, INT32 flags2, fixed_t speed)
{
mobj_t *th;

View file

@ -27,6 +27,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source);
void K_StealBalloon(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_SpawnBobombExplosion(mobj_t *source);
void K_SpawnDriftTrail(player_t *player);
void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost);
void K_DoBouncePad(mobj_t *mo, fixed_t vertispeed);

View file

@ -8270,6 +8270,8 @@ void A_BobombExplode(mobj_t *actor)
for (d = 0; d < 16; d++)
K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64
K_SpawnBobombExplosion(actor);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND);
//S_StartSound(actor, sfx_prloop);

View file

@ -2296,7 +2296,6 @@ static boolean P_ZMovement(mobj_t *mo)
mo->fuse += ((5 - mo->threshold) * TICRATE);
}
break;
case MT_SKIM:
// skims don't bounce
if (mo->z > mo->watertop && mo->z - mo->momz <= mo->watertop)
@ -3039,6 +3038,14 @@ static boolean P_SceneryZMovement(mobj_t *mo)
switch (mo->type)
{
case MT_BOOMPARTICLE:
if ((mo->flags & MF_BOUNCE) && (mo->z <= mo->floorz || mo->z+mo->height >= mo->ceilingz))
{
mo->momz = -mo->momz;
mo->z += mo->momz;
S_StartSound(mo, mo->info->activesound);
}
break;
case MT_SMALLBUBBLE:
if (mo->z <= mo->floorz || mo->z+mo->height >= mo->ceilingz) // Hit the floor, so POP!
{
@ -6697,6 +6704,42 @@ void P_MobjThinker(mobj_t *mobj)
return;
}
break;
case MT_SMOLDERING:
if (leveltime % 2 == 0)
{
fixed_t x = P_RandomRange(-35, 35)*mobj->scale;
fixed_t y = P_RandomRange(-35, 35)*mobj->scale;
fixed_t z = P_RandomRange(0, 70)*mobj->scale;
mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_SMOKE);
smoke->scale = mobj->scale * 2;
smoke->destscale = mobj->scale * 6;
smoke->momz = P_RandomRange(4, 9)*FRACUNIT;
}
break;
case MT_BOOMPARTICLE:
{
fixed_t x = P_RandomRange(-16, 16)*mobj->scale;
fixed_t y = P_RandomRange(-16, 16)*mobj->scale;
fixed_t z = P_RandomRange(0, 32)*mobj->scale;
if (leveltime % 2 == 0)
{
mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_BOSSEXPLODE);
P_SetMobjState(smoke, S_QUICKBOOM1);
smoke->scale = mobj->scale/2;
smoke->destscale = mobj->scale;
}
else
{
mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_SMOKE);
smoke->scale = mobj->scale;
smoke->destscale = mobj->scale*2;
}
if (mobj->tics <= TICRATE)
{
mobj->destscale = FixedDiv(mobj->scale, 100*FRACUNIT);
}
}
break;
case MT_BATTLEBALLOON:
if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo
&& mobj->target->player->health > 0 && !mobj->target->player->spectator)