From e516d09ae453f575c2e10f2bee116e00caef913e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 5 Feb 2018 20:10:20 -0500 Subject: [PATCH] Colored boom Not tested *yet* --- src/k_kart.c | 7 ++++++- src/k_kart.h | 2 +- src/p_enemy.c | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index c0b297d2..098ee4ea 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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 -void K_SpawnBobombExplosion(mobj_t *source) +void K_SpawnBobombExplosion(mobj_t *source, UINT8 color) { INT32 i, radius, height; 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; height = source->height>>FRACBITS; + if (!color) + color = SKINCOLOR_RED; + for (i = 0; i < 32; i++) { 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; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; truc->momz = P_RandomRange(-speed, speed)*FRACUNIT; + truc->color = color; } for (i = 0; i < 16; i++) @@ -2228,6 +2232,7 @@ void K_SpawnBobombExplosion(mobj_t *source) if (P_RandomChance(FRACUNIT/2)) truc->momz = -truc->momz; truc->tics = TICRATE*2; + truc->color = color; } } diff --git a/src/k_kart.h b/src/k_kart.h index 11ec63c6..5ea8efa5 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -27,7 +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_SpawnBobombExplosion(mobj_t *source, UINT8 color); 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); diff --git a/src/p_enemy.c b/src/p_enemy.c index e2c027d3..7c8c898a 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8270,7 +8270,10 @@ 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); + 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);