CArtHandler.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #include "../stdafx.h"
  2. #include "CArtHandler.h"
  3. #include "../CGameInfo.h"
  4. #include "CGeneralTextHandler.h"
  5. #include "CLodHandler.h"
  6. void CArtHandler::loadArtifacts()
  7. {
  8. std::string buf = CGameInfo::mainObj->bitmaph->getTextFile("ARTRAITS.TXT");
  9. int it=0;
  10. std::string dump;
  11. for(int i=0; i<2; ++i)
  12. {
  13. CGeneralTextHandler::loadToIt(dump,buf,it,3);
  14. }
  15. for (int i=0; i<ARTIFACTS_QUANTITY; i++)
  16. {
  17. CArtifact nart;
  18. std::string pom;
  19. CGeneralTextHandler::loadToIt(nart.name,buf,it,4);
  20. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  21. nart.price=atoi(pom.c_str());
  22. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  23. if (pom.length())
  24. nart.spellBook=true;
  25. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  26. if (pom.length())
  27. nart.warMachine4=true;
  28. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  29. if (pom.length())
  30. nart.warMachine3=true;
  31. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  32. if (pom.length())
  33. nart.warMachine2=true;
  34. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  35. if (pom.length())
  36. nart.warMachine1=true;
  37. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  38. if (pom.length())
  39. nart.misc5=true;
  40. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  41. if (pom.length())
  42. nart.misc4=true;
  43. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  44. if (pom.length())
  45. nart.misc3=true;
  46. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  47. if (pom.length())
  48. nart.misc2=true;
  49. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  50. if (pom.length())
  51. nart.misc1=true;
  52. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  53. if (pom.length())
  54. nart.feet=true;
  55. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  56. if (pom.length())
  57. nart.lRing=true;
  58. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  59. if (pom.length())
  60. nart.rRing=true;
  61. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  62. if (pom.length())
  63. nart.torso=true;
  64. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  65. if (pom.length())
  66. nart.lHand=true;
  67. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  68. if (pom.length())
  69. nart.rHand=true;
  70. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  71. if (pom.length())
  72. nart.neck=true;
  73. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  74. if (pom.length())
  75. nart.shoulders=true;
  76. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  77. if (pom.length())
  78. nart.head=true;
  79. CGeneralTextHandler::loadToIt(pom,buf,it,4);
  80. switch (pom[0])
  81. {
  82. case 'S':
  83. nart.aClass=SartClass;
  84. break;
  85. case 'T':
  86. nart.aClass=TartClass;
  87. break;
  88. case 'N':
  89. nart.aClass=NartClass;
  90. break;
  91. case 'J':
  92. nart.aClass=JartClass;
  93. break;
  94. case 'R':
  95. nart.aClass=RartClass;
  96. break;
  97. }
  98. CGeneralTextHandler::loadToIt(nart.description,buf,it,3);
  99. nart.id=artifacts.size();
  100. artifacts.push_back(nart);
  101. }
  102. }