Colored boom

Not tested *yet*
This commit is contained in:
TehRealSalt 2018-02-05 20:10:20 -05:00
parent 0bdacde45e
commit e516d09ae4
3 changed files with 11 additions and 3 deletions

View file

@ -2171,7 +2171,7 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
} }
// Spawns the purely visual explosion // Spawns the purely visual explosion
void K_SpawnBobombExplosion(mobj_t *source) void K_SpawnBobombExplosion(mobj_t *source, UINT8 color)
{ {
INT32 i, radius, height; INT32 i, radius, height;
mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING);
@ -2183,6 +2183,9 @@ void K_SpawnBobombExplosion(mobj_t *source)
radius = source->radius>>FRACBITS; radius = source->radius>>FRACBITS;
height = source->height>>FRACBITS; height = source->height>>FRACBITS;
if (!color)
color = SKINCOLOR_RED;
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE); dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE);
@ -2202,6 +2205,7 @@ void K_SpawnBobombExplosion(mobj_t *source)
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS;
truc->momz = P_RandomRange(-speed, speed)*FRACUNIT; truc->momz = P_RandomRange(-speed, speed)*FRACUNIT;
truc->color = color;
} }
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
@ -2228,6 +2232,7 @@ void K_SpawnBobombExplosion(mobj_t *source)
if (P_RandomChance(FRACUNIT/2)) if (P_RandomChance(FRACUNIT/2))
truc->momz = -truc->momz; truc->momz = -truc->momz;
truc->tics = TICRATE*2; truc->tics = TICRATE*2;
truc->color = color;
} }
} }

View file

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

View file

@ -8270,7 +8270,10 @@ void A_BobombExplode(mobj_t *actor)
for (d = 0; d < 16; d++) 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_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); if (actor->target->player)
K_SpawnBobombExplosion(actor, actor->target->player->skincolor);
else
K_SpawnBobombExplosion(actor, SKINCOLOR_RED);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND); P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND);