#include "stdafx.h"

#include "UI.h"

#include <stdio.h>

#include "Objects.h"
#include "Dispatch.h"
#include "CSB.h"
#include "Data.h"
//#include "UI.h"


#define NUM_MONSTER_TYPE 27

char *monsterNames[27] = 
{
  "Scorpion",
  "SlimeDevil",
  "Giggler",
  "FlyingEye",
  "Hellhound",
  "5",
  "Screamer",
  "RockPile",
  "Rive",
  "StoneGolem",
  "Mummy",
  "BlackFlame",
  "Skeleton",
  "Couatl",
  "Vexirk",
  "Worm",
  "AntMan",
  "Muncher",
  "DethKnight",
  "Zytaz",
  "WaterElemental",
  "Oitu",
  "Demon",
  "LordChaos",
  "Dragon",
  "25",
  "GreyLord"
};


void Statistics(void)
{
  int i, j, len;
  unsigned int *pRecord;
  unsigned int key;
  LISTING list;
  char line[80];
  unsigned int nil[4] = {0,0,0,0};
  list.Clear();
  for (i=0; i<NUM_MONSTER_TYPE; i++)
  {
    key = (EDT_Statistics << 24) + (ESTAT_NumMonsterKilled << 16) + i;
    len = expool.Locate(key, &pRecord);
    if (len < 4) pRecord = nil;
    for (j=0; j<4; j++)
    {
      sprintf(line, "Killed %6d %s(%d)",
                         pRecord[j],monsterNames[i], j);
      list.AddLine(line);
    };
  };
  list.DisplayList("Statistics");
}