MCPcopy Create free account
hub / github.com/diasurgical/devilution / UpdateLifeFlask

Function UpdateLifeFlask

Source/control.cpp:639–652  ·  view source on GitHub ↗

* Controls the drawing of the area of the life flask within the control panel. * First sets the fill amount then draws the empty flask cel portion then the filled * flask portion. */

Source from the content-addressed store, hash-verified

637 * flask portion.
638 */
639void UpdateLifeFlask()
640{
641 int filled = (double)plr[myplr]._pHitPoints / (double)plr[myplr]._pMaxHP * 80.0;
642 plr[myplr]._pHPPer = filled;
643
644 if (filled > 69)
645 filled = 69;
646 else if (filled < 0)
647 filled = 0;
648 if (filled != 69)
649 SetFlaskHeight(pLifeBuff, 16, 85 - filled, 96 + PANEL_X, PANEL_Y);
650 if (filled)
651 DrawPanelBox(96, 85 - filled, 88, filled, 96 + PANEL_X, PANEL_Y + 69 - filled);
652}
653
654void DrawManaFlask()
655{

Callers 1

DrawAndBlitFunction · 0.85

Calls 2

SetFlaskHeightFunction · 0.85
DrawPanelBoxFunction · 0.85

Tested by

no test coverage detected