mapstats.acs 1020 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #library "mapstats"
  2. #include "zcommon.acs"
  3. global int 51:killprc;
  4. global int 52:itemprc;
  5. global int 53:scrtprc;
  6. global int 54:killcount;
  7. global int 55:itemcount;
  8. global int 56:scrtcount;
  9. script "statscalc" ENTER
  10. {
  11. if (GameType() == GAME_TITLE_MAP || GameType() == GAME_NET_DEATHMATCH) { Terminate; }
  12. while (1)
  13. {
  14. int mtotal = GetLevelInfo (LEVELINFO_TOTAL_MONSTERS);
  15. int mkilled = GetLevelInfo (LEVELINFO_KILLED_MONSTERS);
  16. int itotal = GetLevelInfo (LEVELINFO_TOTAL_ITEMS);
  17. int ifound = GetLevelInfo (LEVELINFO_FOUND_ITEMS);
  18. int stotal = GetLevelInfo (LEVELINFO_TOTAL_SECRETS);
  19. int sfound = GetLevelInfo (LEVELINFO_FOUND_SECRETS);
  20. if (mtotal > 0) { killprc = (mkilled * 100) / mtotal; }
  21. else { killprc = 100; }
  22. if (itotal > 0) { itemprc = (ifound * 100) / itotal; }
  23. else { itemprc = 100; }
  24. if (stotal > 0) { scrtprc = (sfound * 100) / stotal; }
  25. else { scrtprc = 100; }
  26. killcount = mtotal - mkilled;
  27. itemcount = itotal - ifound;
  28. scrtcount = stotal - sfound;
  29. delay(35);
  30. }
  31. }