CArtHandler.cpp 2.8 KB

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