PrintStats.h
void PrintStats(FILE *log, unsigned char *entrybuffer, unsigned char basesetting, unsigned char growthsetting, FILE *rom, int header, unsigned char class, unsigned char *blood)
{
  int length = 1, statsclone, i, k, classbase, holybloodgrowth[8] = {0};
  
  /* Find the combined growths for this character's holy blood */
  FindHolyBloodGrowth(rom, header, blood, holybloodgrowth);
  
  fprintf(log, "Stats:\n");
  fprintf(log, "|  HP | Str | Mag | Skl | Spd | Def | Res | Lck |\n");
  if(basesetting > '0')
  {
    for(i = 0; i < 8; i++)
    {
      length = 1;
      /* Get the relevant class base */
      if(i > 0 && i < 7)  
      {
        fseek(rom, CLASSBASE + header + i-1 + (class*CLASSSIZE), SEEK_SET);
        classbase = fgetc(rom);
      }
      else
      {
        /* HP and Luck excluded */
        classbase = 0;
      }
      
      /* Determining nr of digits */
      statsclone = entrybuffer[i] + classbase;
      while(statsclone /= 10)
      {
        length++;
      }
      fputc('|', log);
      for(k = 0; k < (4 - length); k++)
      {
        fputc(' ', log);
      }
      fprintf(log, "%d", entrybuffer[i] + classbase);
      fputc(' ', log);
    }
    fputc('|', log);
    fputc('\n', log);
  }
  if(growthsetting > '0')
  {
    for(i = 0; i < 8; i++)
    {
      length = 1;
      /* Determining nr of digits */
      statsclone = entrybuffer[i+GROWTH]+holybloodgrowth[i];
      while(statsclone /= 10)
      {
        length++;
      }
      fputc('|', log);
      for(k = 0; k < (3 - length); k++)
      {
        fputc(' ', log);
      }
      fprintf(log, "%d", entrybuffer[i+GROWTH]+holybloodgrowth[i]);
      fputc('%', log);
      fputc(' ', log);
    }
    fputc('|', log);
    fputc('\n', log);
    fputc('\n', log);
  }
  
  return;
}
/* Funtion for printing stats to a file */
Funtion for printing stats to a file
Funtion for printing stats to a file
void PrintStats(FILE *log, unsigned char *entrybuffer, unsigned char basesetting, unsigned char growthsetting, FILE *rom, int header, unsigned char class, unsigned char *blood)
{
  int length = 1, statsclone, i, k, classbase, holybloodgrowth[8] = {0};
  FindHolyBloodGrowth(rom, header, blood, holybloodgrowth);
  fprintf(log, "Stats:\n");
  fprintf(log, "|  HP | Str | Mag | Skl | Spd | Def | Res | Lck |\n");
  if(basesetting > '0')
  {
    for(i = 0; i < 8; i++)
    {
      length = 1;
      if(i > 0 && i < 7)  
      {
        fseek(rom, CLASSBASE + header + i-1 + (class*CLASSSIZE), SEEK_SET);
        classbase = fgetc(rom);
      }
      else
      {
        classbase = 0;
      }
      statsclone = entrybuffer[i] + classbase;
      while(statsclone /= 10)
      {
        length++;
      }
      fputc('|', log);
      for(k = 0; k < (4 - length); k++)
      {
        fputc(' ', log);
      }
      fprintf(log, "%d", entrybuffer[i] + classbase);
      fputc(' ', log);
    }
    fputc('|', log);
    fputc('\n', log);
  }
  if(growthsetting > '0')
  {
    for(i = 0; i < 8; i++)
    {
      length = 1;
      statsclone = entrybuffer[i+GROWTH]+holybloodgrowth[i];
      while(statsclone /= 10)
      {
        length++;
      }
      fputc('|', log);
      for(k = 0; k < (3 - length); k++)
      {
        fputc(' ', log);
      }
      fprintf(log, "%d", entrybuffer[i+GROWTH]+holybloodgrowth[i]);
      fputc('%', log);
      fputc(' ', log);
    }
    fputc('|', log);
    fputc('\n', log);
    fputc('\n', log);
  }
  return;
}
void PrintStats ( FILE * log , unsigned char * entrybuffer , unsigned char basesetting , unsigned char growthsetting , FILE * rom , int header , unsigned char class , unsigned char * blood ) { int length = 1 , statsclone , i , k , classbase , holybloodgrowth [ 8 ] = { 0 } ; FindHolyBloodGrowth ( rom , header , blood , holybloodgrowth ) ; fprintf ( log , " \n " ) ; fprintf ( log , " \n " ) ; if ( basesetting > ' ' ) { for ( i = 0 ; i < 8 ; i ++ ) { length = 1 ; if ( i > 0 && i < 7 ) { fseek ( rom , CLASSBASE + header + i - 1 + ( class * CLASSSIZE ) , SEEK_SET ) ; classbase = fgetc ( rom ) ; } else { classbase = 0 ; } statsclone = entrybuffer [ i ] + classbase ; while ( statsclone /= 10 ) { length ++ ; } fputc ( ' ' , log ) ; for ( k = 0 ; k < ( 4 - length ) ; k ++ ) { fputc ( ' ' , log ) ; } fprintf ( log , " " , entrybuffer [ i ] + classbase ) ; fputc ( ' ' , log ) ; } fputc ( ' ' , log ) ; fputc ( ' \n ' , log ) ; } if ( growthsetting > ' ' ) { for ( i = 0 ; i < 8 ; i ++ ) { length = 1 ; statsclone = entrybuffer [ i + GROWTH ] + holybloodgrowth [ i ] ; while ( statsclone /= 10 ) { length ++ ; } fputc ( ' ' , log ) ; for ( k = 0 ; k < ( 3 - length ) ; k ++ ) { fputc ( ' ' , log ) ; } fprintf ( log , " " , entrybuffer [ i + GROWTH ] + holybloodgrowth [ i ] ) ; fputc ( ' ' , log ) ; fputc ( ' ' , log ) ; } fputc ( ' ' , log ) ; fputc ( ' \n ' , log ) ; fputc ( ' \n ' , log ) ; } return ; }
Funtion for printing stats to a file
Funtion for printing stats to a file
/* Find the combined growths for this character's holy blood */ /* Get the relevant class base */ /* HP and Luck excluded */ /* Determining nr of digits */ /* Determining nr of digits */