* Controls the drawing of the area of the life flask within the control panel. * Also for some reason draws the current right mouse button spell. */
| 688 | * Also for some reason draws the current right mouse button spell. |
| 689 | */ |
| 690 | void UpdateManaFlask() |
| 691 | { |
| 692 | int filled; |
| 693 | int maxMana = plr[myplr]._pMaxMana; |
| 694 | int mana = plr[myplr]._pMana; |
| 695 | if (maxMana < 0) |
| 696 | maxMana = 0; |
| 697 | if (mana < 0) |
| 698 | mana = 0; |
| 699 | |
| 700 | if (maxMana == 0) |
| 701 | filled = 0; |
| 702 | else |
| 703 | filled = (double)mana / (double)maxMana * 80.0; |
| 704 | |
| 705 | plr[myplr]._pManaPer = filled; |
| 706 | |
| 707 | if (filled > 69) |
| 708 | filled = 69; |
| 709 | if (filled != 69) |
| 710 | SetFlaskHeight(pManaBuff, 16, 85 - filled, 96 + PANEL_X + 368, PANEL_Y); |
| 711 | if (filled) |
| 712 | DrawPanelBox(96 + 368, 85 - filled, 88, filled, 96 + PANEL_X + 368, PANEL_Y + 69 - filled); |
| 713 | |
| 714 | DrawSpell(); |
| 715 | } |
| 716 | |
| 717 | void InitControlPan() |
| 718 | { |
no test coverage detected