| 878 | VARP(accuracy,0,0,1); |
| 879 | |
| 880 | void r_accuracy(int h) |
| 881 | { |
| 882 | int i = player1->weaponsel->type; |
| 883 | if(accuracy && valid_weapon(i)) |
| 884 | { |
| 885 | int x_offset = 2 * HUDPOS_X_BOTTOMLEFT, y_offset = 2 * (h - 1.75 * FONTH); |
| 886 | string line; |
| 887 | float acc = accuracym[i].shots ? 100.0 * accuracym[i].hits / (float)accuracym[i].shots : 0; |
| 888 | if(i == GUN_GRENADE || i == GUN_SHOTGUN) |
| 889 | { |
| 890 | formatstring(line)("\f5%5.1f%% (%.1f/%d): \f0%s", acc, accuracym[i].hits, accuracym[i].shots, weapstr(i)); |
| 891 | } |
| 892 | else |
| 893 | { |
| 894 | formatstring(line)("\f5%5.1f%% (%d/%d): \f0%s", acc, (int)accuracym[i].hits, accuracym[i].shots, weapstr(i)); |
| 895 | } |
| 896 | blendbox(x_offset, y_offset + FONTH, x_offset + text_width(line) + 2 * FONTH, y_offset - FONTH, false, -1); |
| 897 | draw_textf("%s", x_offset + FONTH, y_offset - 0.5 * FONTH, line); |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | void accuracyinfo() |
| 902 | { |
no test coverage detected