Versus roulette: Speed up based on boss healthbar (destination) fill %

This commit is contained in:
toaster 2023-04-22 00:35:11 +01:00
parent fdd5ee8dfc
commit 5c60a0958f

View file

@ -73,6 +73,7 @@
#define ROULETTE_SPEED_FASTEST (2)
#define ROULETTE_SPEED_DIST (150*DISTVAR)
#define ROULETTE_SPEED_TIMEATTACK (9)
#define ROULETTE_SPEED_VERSUS_SLOWEST (12)
static UINT8 K_KartItemOddsRace[NUMKARTRESULTS-1][8] =
{
@ -1135,6 +1136,14 @@ static void K_CalculateRouletteSpeed(itemroulette_t *const roulette)
fixed_t progress = 0;
fixed_t total = 0;
if (bossinfo.valid == true)
{
// Boss in action, use a speed controlled by boss health
total = FixedDiv(bossinfo.healthbar, BOSSHEALTHBARLEN);
roulette->tics = roulette->speed = ROULETTE_SPEED_FASTEST + FixedMul(ROULETTE_SPEED_VERSUS_SLOWEST - ROULETTE_SPEED_FASTEST, total);
return;
}
if (K_TimeAttackRules() == true)
{
// Time Attack rules; use a consistent speed.