Merge branch 'forceshieldhp' into 'next'

Show extra Force Shield hits using text instead of stacking more icons

See merge request STJr/SRB2!2378
This commit is contained in:
sphere 2024-03-07 12:22:35 +00:00
commit 6adfe7a829

View file

@ -1553,13 +1553,16 @@ static void ST_drawPowerupHUD(void)
{ {
shieldoffs[q] = ICONSEP; shieldoffs[q] = ICONSEP;
if ((stplyr->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE) if ((stplyr->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE
&& (stplyr->powers[pw_shield] & SH_FORCEHP) > 0) // Special handling for >1HP Force Shields
{ {
UINT8 i, max = (stplyr->powers[pw_shield] & SH_FORCEHP); UINT8 max = (stplyr->powers[pw_shield] & SH_FORCEHP);
for (i = 0; i <= max; i++)
{ V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANSHALF, forceshield);
V_DrawSmallScaledPatch(offs-(i<<1), hudinfo[HUD_POWERUPS].y-(i<<1), (V_PERPLAYER|hudinfo[HUD_POWERUPS].f)|((i == max) ? V_HUDTRANS : V_HUDTRANSHALF), forceshield); V_DrawSmallScaledPatch(offs-2, hudinfo[HUD_POWERUPS].y-2, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, forceshield);
}
if (max > 1) // if the shield has more than 2 hits, show the extra n hits as "+n"
V_DrawRightAlignedThinString(offs+16, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, va("+%d", max - 1));
} }
else else
{ {
@ -1569,6 +1572,7 @@ static void ST_drawPowerupHUD(void)
case SH_ELEMENTAL: p = watershield; break; case SH_ELEMENTAL: p = watershield; break;
case SH_ARMAGEDDON: p = bombshield; break; case SH_ARMAGEDDON: p = bombshield; break;
case SH_ATTRACT: p = ringshield; break; case SH_ATTRACT: p = ringshield; break;
case SH_FORCE: p = forceshield; break;
case SH_PITY: p = pityshield; break; case SH_PITY: p = pityshield; break;
case SH_PINK: p = pinkshield; break; case SH_PINK: p = pinkshield; break;
case SH_FLAMEAURA: p = flameshield; break; case SH_FLAMEAURA: p = flameshield; break;