src/hcode/btech/p.mech.stat.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void init_stat (void)
void do_show_stat (dbref player, dbref cause, int key, char *arg1, char *arg2)


Function Documentation

void do_show_stat ( dbref  player,
dbref  cause,
int  key,
char *  arg1,
char *  arg2 
)

Definition at line 30 of file mech.stat.c.

References chances, notify, notify_printf(), stat_type::rolls, rollstat, and stat_type::totrolls.

00031 {
00032         int i;
00033         float f1, f2;
00034 
00035         if(!rollstat.totrolls) {
00036                 notify(player, "No rolls to show statistics for!");
00037                 return;
00038         }
00039         for(i = 0; i < 11; i++) {
00040                 if(i == 0) {
00041                         notify(player, "#   Rolls  Optimal% Present% Diff. in 1000");
00042                 }
00043                 f1 = (float) chances[i] * 100.0 / 36.0;
00044                 f2 = (float) rollstat.rolls[i] * 100.0 / rollstat.totrolls;
00045                 notify_printf(player, "%-3d %6d %8.3f %8.3f %.3f", i + 2,
00046                                           rollstat.rolls[i], f1, f2, 10.0 * f2 - 10.0 * f1);
00047         }
00048         notify_printf(player, "Total rolls: %d", rollstat.totrolls);
00049 }

void init_stat ( void   ) 

Definition at line 22 of file mech.stat.c.

Referenced by LoadSpecialObjects().

00023 {
00024         /* This is not necessary -- globals are always initialized empty */
00025         /* bzero(&stat, sizeof(stat)); */
00026 }


Generated on Mon May 28 04:25:42 2007 for BattletechMUX by  doxygen 1.4.7