- Exhumed: added a countdown display for the magic spells in the fullscreen HUD.

This commit is contained in:
Christoph Oelckers 2020-11-24 21:04:27 +01:00
parent 7470286d5b
commit 0b115ac9c7
2 changed files with 26 additions and 2 deletions

View file

@ -83,7 +83,7 @@ int LoadPaletteLookups()
// Other changes than altering the fog gradient are not necessary. // Other changes than altering the fog gradient are not necessary.
lookups.tables[kPalTorch].ShadeFactor = lookups.tables[kPalTorch2].ShadeFactor = (numshades - 2) / 20.f; lookups.tables[kPalTorch].ShadeFactor = lookups.tables[kPalTorch2].ShadeFactor = (numshades - 2) / 20.f;
lookups.tables[kPalNoTorch].ShadeFactor = lookups.tables[kPalNoTorch2].ShadeFactor = (numshades - 2) / 4.f; lookups.tables[kPalNoTorch].ShadeFactor = lookups.tables[kPalNoTorch2].ShadeFactor = (numshades - 2) / 4.f;
lookups.tables[kPalBrite].ShadeFactor = lookups.tables[kPalBrite].ShadeFactor = (numshades - 2) / 128.f; lookups.tables[kPalBrite].ShadeFactor = lookups.tables[kPalBrite2].ShadeFactor = (numshades - 2) / 128.f;
lookups.setFadeColor(kPalRedBrite, 255, 0, 0); lookups.setFadeColor(kPalRedBrite, 255, 0, 0);
} }

View file

@ -150,6 +150,23 @@ void InitStatus()
statusy = ydim - 200; statusy = ydim - 200;
} }
int ItemTimer(int num, int plr)
{
switch (num) {
case 1: //Scarab item
return (PlayerList[plr].invincibility * 100) / 900;
case 3: //Hand item
return (nPlayerDouble[plr] * 100) / 1350;
case 5: //Mask
return (PlayerList[plr].nMaskAmount * 100) / 1350;
case 4: //Invisible
return (nPlayerInvisible[plr] * 100) / 900;
case 2: //Torch
return (nPlayerTorch[plr] * 100) / 900;
}
return -1;
}
int BuildStatusAnim(int val, int nFlags) int BuildStatusAnim(int val, int nFlags)
{ {
@ -773,6 +790,13 @@ private:
DrawGraphic(img, 70, -1, DI_ITEM_CENTER_BOTTOM, 1., -1, -1, imgScale, imgScale); DrawGraphic(img, 70, -1, DI_ITEM_CENTER_BOTTOM, 1., -1, -1, imgScale, imgScale);
format.Format("%d", pp->nMagic / 10); format.Format("%d", pp->nMagic / 10);
short nItem = nPlayerItem[nLocalPlayer];
int timer = ItemTimer(nItem, nLocalPlayer);
if (timer > 0)
{
format.AppendFormat("/%d", timer);
}
SBar_DrawString(this, numberFont, format, 79.5, -numberFont->mFont->GetHeight() + 3, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, 1, 0, 0, 1, 1); SBar_DrawString(this, numberFont, format, 79.5, -numberFont->mFont->GetHeight() + 3, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
} }
// //