Add Bumper power-up, give 5 bumpers to the player

This commit is contained in:
James R 2023-06-29 19:06:22 -07:00
parent dafdb0fc10
commit 065475ea29
2 changed files with 12 additions and 2 deletions

View file

@ -35,6 +35,10 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
player->powerup.barrierTimer += time;
break;
case POWERUP_BUMPER:
K_GiveBumpersToPlayer(player, nullptr, 5);
break;
case POWERUP_SUPERFLICKY:
if (K_PowerUpRemaining(player, POWERUP_SUPERFLICKY))
{

View file

@ -3,6 +3,12 @@
#include "../k_objects.h"
#include "../p_local.h"
#include "../k_kart.h"
#include "../k_powerup.h"
static INT16 guard_upscale (player_t *player)
{
return K_PowerUpRemaining(player, POWERUP_BARRIER) ? 40 : player->spheres;
}
void Obj_BlockRingThink (mobj_t *ring)
{
@ -22,7 +28,7 @@ void Obj_BlockRingThink (mobj_t *ring)
ring->color = mo->color;
fixed_t baseScale = mo->scale / 2;
baseScale += (mo->scale / 30) * player->spheres;
baseScale += (mo->scale / 30) * guard_upscale(player);
P_SetScale(ring, baseScale);
// Twirl
@ -55,7 +61,7 @@ void Obj_BlockBodyThink (mobj_t *body)
body->flags &= ~(MF_NOCLIPTHING);
fixed_t baseScale = mo->scale / 2;
baseScale += (mo->scale / 30) * player->spheres;
baseScale += (mo->scale / 30) * guard_upscale(player);
P_SetScale(body, baseScale);
P_MoveOrigin(body, mo->x, mo->y, mo->z + mo->height/2);