CCreatureHandler.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. #define VCMI_DLL
  2. #include "../stdafx.h"
  3. #include "CCreatureHandler.h"
  4. #include "CLodHandler.h"
  5. #include <sstream>
  6. #include <boost/assign/std/set.hpp>
  7. #include <boost/assign/std/vector.hpp>
  8. #include <boost/assign/list_of.hpp>
  9. #include <boost/algorithm/string.hpp>
  10. #include <boost/algorithm/string/find.hpp>
  11. #include <boost/algorithm/string/replace.hpp>
  12. #include "../lib/VCMI_Lib.h"
  13. using namespace boost::assign;
  14. extern CLodHandler * bitmaph;
  15. /*
  16. * CCreatureHandler.cpp, part of VCMI engine
  17. *
  18. * Authors: listed in file AUTHORS in main folder
  19. *
  20. * License: GNU General Public License v2.0 or later
  21. * Full text of license available in license.txt file, in main folder
  22. *
  23. */
  24. static std::vector<int> getMindSpells()
  25. {
  26. std::vector<int> ret;
  27. ret.push_back(50); //sorrow
  28. ret.push_back(59); //berserk
  29. ret.push_back(60); //hypnotize
  30. ret.push_back(61); //forgetfulness
  31. ret.push_back(62); //blind
  32. return ret;
  33. }
  34. CCreatureHandler::CCreatureHandler()
  35. {
  36. VLC->creh = this;
  37. // Set the faction alignments to the defaults:
  38. // Good: Castle, Rampart, Tower // Evil: Inferno, Necropolis, Dungeon
  39. // Neutral: Stronghold, Fortess, Conflux
  40. factionAlignments += 1, 1, 1, -1, -1, -1, 0, 0, 0;
  41. }
  42. int CCreature::getQuantityID(const int & quantity)
  43. {
  44. if (quantity<5)
  45. return 0;
  46. if (quantity<10)
  47. return 1;
  48. if (quantity<20)
  49. return 2;
  50. if (quantity<50)
  51. return 3;
  52. if (quantity<100)
  53. return 4;
  54. if (quantity<250)
  55. return 5;
  56. if (quantity<500)
  57. return 5;
  58. if (quantity<1000)
  59. return 6;
  60. if (quantity<4000)
  61. return 7;
  62. return 8;
  63. }
  64. bool CCreature::isDoubleWide() const
  65. {
  66. return vstd::contains(abilities, StackFeature::DOUBLE_WIDE);
  67. }
  68. bool CCreature::isFlying() const
  69. {
  70. return vstd::contains(abilities, StackFeature::FLYING);
  71. }
  72. bool CCreature::isShooting() const
  73. {
  74. return vstd::contains(abilities, StackFeature::SHOOTER);
  75. }
  76. bool CCreature::isUndead() const
  77. {
  78. return vstd::contains(abilities, StackFeature::UNDEAD);
  79. }
  80. /**
  81. * Determines if the creature is of a good alignment.
  82. * @return true if the creture is good, false otherwise.
  83. */
  84. bool CCreature::isGood () const
  85. {
  86. return VLC->creh->isGood(faction);
  87. }
  88. /**
  89. * Determines if the creature is of an evil alignment.
  90. * @return true if the creature is evil, false otherwise.
  91. */
  92. bool CCreature::isEvil () const
  93. {
  94. return VLC->creh->isEvil(faction);
  95. }
  96. si32 CCreature::maxAmount(const std::vector<si32> &res) const //how many creatures can be bought
  97. {
  98. int ret = 2147483645;
  99. int resAmnt = std::min(res.size(),cost.size());
  100. for(int i=0;i<resAmnt;i++)
  101. if(cost[i])
  102. ret = std::min(ret,(int)(res[i]/cost[i]));
  103. return ret;
  104. }
  105. int readNumber(int & befi, int & i, int andame, std::string & buf) //helper function for void CCreatureHandler::loadCreatures() and loadUnitAnimInfo()
  106. {
  107. befi=i;
  108. for(i; i<andame; ++i)
  109. {
  110. if(buf[i]=='\t')
  111. break;
  112. }
  113. std::string tmp = buf.substr(befi, i-befi);
  114. int ret = atoi(buf.substr(befi, i-befi).c_str());
  115. ++i;
  116. return ret;
  117. }
  118. float readFloat(int & befi, int & i, int andame, std::string & buf) //helper function for void CCreatureHandler::loadUnitAnimInfo()
  119. {
  120. befi=i;
  121. for(i; i<andame; ++i)
  122. {
  123. if(buf[i]=='\t')
  124. break;
  125. }
  126. std::string tmp = buf.substr(befi, i-befi);
  127. float ret = atof(buf.substr(befi, i-befi).c_str());
  128. ++i;
  129. return ret;
  130. }
  131. /**
  132. * Determines if a faction is good.
  133. * @param ID of the faction.
  134. * @return true if the faction is good, false otherwise.
  135. */
  136. bool CCreatureHandler::isGood (si8 faction) const
  137. {
  138. return faction != -1 && factionAlignments[faction] == 1;
  139. }
  140. /**
  141. * Determines if a faction is evil.
  142. * @param ID of the faction.
  143. * @return true if the faction is evil, false otherwise.
  144. */
  145. bool CCreatureHandler::isEvil (si8 faction) const
  146. {
  147. return faction != -1 && factionAlignments[faction] == -1;
  148. }
  149. void CCreatureHandler::loadCreatures()
  150. {
  151. notUsedMonsters += 122,124,126,128,145,146,147,148,149,160,161,162,163,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191;
  152. tlog5 << "\t\tReading config/cr_abils.txt and ZCRTRAIT.TXT" << std::endl;
  153. bool useCreAbilsFromZCRTRAIT = true;
  154. ////////////reading cr_abils.txt ///////////////////
  155. std::ifstream abils("config" PATHSEPARATOR "cr_abils.txt", std::ios::in | std::ios::binary); //this file is not in lod
  156. const int MAX_LINE_SIZE = 1000;
  157. char abilLine[MAX_LINE_SIZE+1];
  158. for(int i=0; i<5; ++i) //removing 5 comment lines
  159. {
  160. abils.getline(abilLine, MAX_LINE_SIZE);
  161. }
  162. //reading first line (determining if we should use creature abilities from ZCRTRAIT.TXT)
  163. abils.getline(abilLine, MAX_LINE_SIZE);
  164. useCreAbilsFromZCRTRAIT = atoi(abilLine);
  165. ////////////reading ZCRTRAIT.TXT ///////////////////
  166. std::string buf = bitmaph->getTextFile("ZCRTRAIT.TXT");
  167. int andame = buf.size();
  168. int i=0; //buf iterator
  169. int hmcr=0;
  170. for(i; i<andame; ++i)
  171. {
  172. if(buf[i]=='\r')
  173. ++hmcr;
  174. if(hmcr==2)
  175. break;
  176. }
  177. i+=2;
  178. while(i<buf.size())
  179. {
  180. CCreature ncre;
  181. ncre.cost.resize(RESOURCE_QUANTITY);
  182. ncre.level=0;
  183. ncre.sounds.attack = soundBase::invalid;
  184. ncre.sounds.defend = soundBase::invalid;
  185. ncre.sounds.killed = soundBase::invalid;
  186. ncre.sounds.move = soundBase::invalid;
  187. ncre.sounds.shoot = soundBase::invalid;
  188. ncre.sounds.wince = soundBase::invalid;
  189. ncre.sounds.ext1 = soundBase::invalid;
  190. ncre.sounds.ext2 = soundBase::invalid;
  191. ncre.sounds.startMoving = soundBase::invalid;
  192. ncre.sounds.endMoving = soundBase::invalid;
  193. int befi=i;
  194. for(i; i<andame; ++i)
  195. {
  196. if(buf[i]=='\t')
  197. break;
  198. }
  199. ncre.nameSing = buf.substr(befi, i-befi);
  200. ++i;
  201. befi=i;
  202. for(i; i<andame; ++i)
  203. {
  204. if(buf[i]=='\t')
  205. break;
  206. }
  207. ncre.namePl = buf.substr(befi, i-befi);
  208. ++i;
  209. for(int v=0; v<7; ++v)
  210. {
  211. ncre.cost[v] = readNumber(befi, i, andame, buf);
  212. }
  213. ncre.fightValue = readNumber(befi, i, andame, buf);
  214. ncre.AIValue = readNumber(befi, i, andame, buf);
  215. ncre.growth = readNumber(befi, i, andame, buf);
  216. ncre.hordeGrowth = readNumber(befi, i, andame, buf);
  217. ncre.hitPoints = readNumber(befi, i, andame, buf);
  218. ncre.speed = readNumber(befi, i, andame, buf);
  219. ncre.attack = readNumber(befi, i, andame, buf);
  220. ncre.defence = readNumber(befi, i, andame, buf);
  221. ncre.damageMin = readNumber(befi, i, andame, buf);
  222. ncre.damageMax = readNumber(befi, i, andame, buf);
  223. ncre.shots = readNumber(befi, i, andame, buf);
  224. ncre.spells = readNumber(befi, i, andame, buf);
  225. ncre.ammMin = readNumber(befi, i, andame, buf);
  226. ncre.ammMax = readNumber(befi, i, andame, buf);
  227. befi=i;
  228. for(i; i<andame; ++i)
  229. {
  230. if(buf[i]=='\t')
  231. break;
  232. }
  233. ncre.abilityText = buf.substr(befi, i-befi);
  234. ++i;
  235. befi=i;
  236. for(i; i<andame; ++i)
  237. {
  238. if(buf[i]=='\r')
  239. break;
  240. }
  241. ncre.abilityRefs = buf.substr(befi, i-befi);
  242. i+=2;
  243. if(useCreAbilsFromZCRTRAIT)
  244. { //adding abilities from ZCRTRAIT.TXT
  245. if(boost::algorithm::find_first(ncre.abilityRefs, "DOUBLE_WIDE"))
  246. ncre.abilities.push_back(makeCreatureAbility(StackFeature::DOUBLE_WIDE, 0));
  247. if(boost::algorithm::find_first(ncre.abilityRefs, "FLYING_ARMY"))
  248. ncre.abilities.push_back(makeCreatureAbility(StackFeature::FLYING, 0));
  249. if(boost::algorithm::find_first(ncre.abilityRefs, "SHOOTING_ARMY"))
  250. ncre.abilities.push_back(makeCreatureAbility(StackFeature::SHOOTER, 0));
  251. if(boost::algorithm::find_first(ncre.abilityRefs, "SIEGE_WEAPON"))
  252. ncre.abilities.push_back(makeCreatureAbility(StackFeature::SIEGE_WEAPON, 0));
  253. if(boost::algorithm::find_first(ncre.abilityRefs, "const_two_attacks"))
  254. ncre.abilities.push_back(makeCreatureAbility(StackFeature::ADDITIONAL_ATTACK, 1));
  255. if(boost::algorithm::find_first(ncre.abilityRefs, "const_free_attack"))
  256. ncre.abilities.push_back(makeCreatureAbility(StackFeature::BLOCKS_RETALIATION, 0));
  257. if(boost::algorithm::find_first(ncre.abilityRefs, "IS_UNDEAD"))
  258. ncre.abilities.push_back(makeCreatureAbility(StackFeature::UNDEAD, 0));
  259. if(boost::algorithm::find_first(ncre.abilityRefs, "const_no_melee_penalty"))
  260. ncre.abilities.push_back(makeCreatureAbility(StackFeature::NO_MELEE_PENALTY, 0));
  261. if(boost::algorithm::find_first(ncre.abilityRefs, "const_jousting"))
  262. ncre.abilities.push_back(makeCreatureAbility(StackFeature::JOUSTING, 0));
  263. if(boost::algorithm::find_first(ncre.abilityRefs, "const_raises_morale"))
  264. ncre.abilities.push_back(makeCreatureAbility(StackFeature::RAISING_MORALE, 1));
  265. if(boost::algorithm::find_first(ncre.abilityRefs, "const_lowers_morale"))
  266. ncre.abilities.push_back(makeCreatureAbility(StackFeature::ENEMY_MORALE_DECREASING, 1));
  267. if(boost::algorithm::find_first(ncre.abilityRefs, "KING_1"))
  268. ncre.abilities.push_back(makeCreatureAbility(StackFeature::KING1, 0));
  269. if(boost::algorithm::find_first(ncre.abilityRefs, "KING_2"))
  270. ncre.abilities.push_back(makeCreatureAbility(StackFeature::KING2, 0));
  271. if(boost::algorithm::find_first(ncre.abilityRefs, "KING_3"))
  272. ncre.abilities.push_back(makeCreatureAbility(StackFeature::KING3, 0));
  273. if(boost::algorithm::find_first(ncre.abilityRefs, "const_no_wall_penalty"))
  274. ncre.abilities.push_back(makeCreatureAbility(StackFeature::NO_WALL_PENALTY, 0));
  275. if(boost::algorithm::find_first(ncre.abilityRefs, "CATAPULT"))
  276. ncre.abilities.push_back(makeCreatureAbility(StackFeature::CATAPULT, 0));
  277. if(boost::algorithm::find_first(ncre.abilityRefs, "MULTI_HEADED"))
  278. ncre.abilities.push_back(makeCreatureAbility(StackFeature::ATTACKS_ALL_ADJACENT, 0));
  279. if(boost::algorithm::find_first(ncre.abilityRefs, "IMMUNE_TO_MIND_SPELLS"))
  280. {
  281. std::vector<int> mindSpells = getMindSpells();
  282. for(int g=0; g<mindSpells.size(); ++g)
  283. {
  284. creatures[40].abilities += makeCreatureAbility(StackFeature::SPELL_IMMUNITY, 0, mindSpells[g]); //giants are immune to mind spells
  285. }
  286. }
  287. if(boost::algorithm::find_first(ncre.abilityRefs, "IMMUNE_TO_FIRE_SPELLS"))
  288. ncre.abilities.push_back(makeCreatureAbility(StackFeature::FIRE_IMMUNITY, 0));
  289. if(boost::algorithm::find_first(ncre.abilityRefs, "HAS_EXTENDED_ATTACK"))
  290. ncre.abilities.push_back(makeCreatureAbility(StackFeature::TWO_HEX_ATTACK_BREATH, 0));
  291. }
  292. if(ncre.nameSing!=std::string("") && ncre.namePl!=std::string(""))
  293. {
  294. ncre.idNumber = creatures.size();
  295. creatures.push_back(ncre);
  296. }
  297. }
  298. // Map types names
  299. #define VCMI_CREATURE_ABILITY_NAME(x) ( #x, StackFeature::x )
  300. static const std::map<std::string, int> type_list = map_list_of VCMI_CREATURE_ABILITY_LIST;
  301. #undef VCMI_CREATURE_ABILITY_NAME
  302. ////second part of reading cr_abils.txt////
  303. bool contReading = true;
  304. while(contReading) //main reading loop
  305. {
  306. abils.getline(abilLine, MAX_LINE_SIZE);
  307. std::istringstream reader(abilLine);
  308. char command;
  309. reader >> command;
  310. switch(command)
  311. {
  312. case '+': //add new ability
  313. {
  314. int creatureID;
  315. StackFeature nsf;
  316. si32 buf;
  317. std::string type;
  318. reader >> creatureID;
  319. reader >> type;
  320. std::map<std::string, int>::const_iterator it = type_list.find(type);
  321. if (it == type_list.end()) {
  322. tlog1 << "Error: invalid type " << type << " in cr_abils.txt" << std::endl;
  323. break;
  324. }
  325. nsf.type = it->second;
  326. reader >> buf; nsf.value = buf;
  327. reader >> buf; nsf.subtype = buf;
  328. reader >> buf; nsf.additionalInfo = buf;
  329. nsf.source = StackFeature::CREATURE_ABILITY;
  330. nsf.duration = StackFeature::WHOLE_BATTLE;
  331. nsf.turnsRemain = 0;
  332. creatures[creatureID].abilities += nsf;
  333. break;
  334. }
  335. case '-': //remove ability
  336. {
  337. int creatureID;
  338. std::string type;
  339. reader >> creatureID;
  340. reader >> type;
  341. std::map<std::string, int>::const_iterator it = type_list.find(type);
  342. if (it == type_list.end())
  343. {
  344. tlog1 << "Error: invalid type " << type << " in cr_abils.txt" << std::endl;
  345. break;
  346. }
  347. int typeNo = it->second;
  348. StackFeature::ECombatFeatures ecf = static_cast<StackFeature::ECombatFeatures>(typeNo);
  349. creatures[creatureID].abilities -= ecf;
  350. break;
  351. }
  352. case '0': //end reading
  353. {
  354. contReading = false;
  355. break;
  356. }
  357. default: //invalid command
  358. {
  359. tlog1 << "Parse error in file config/cr_abils.txt" << std::endl;
  360. break;
  361. }
  362. }
  363. }
  364. abils.close();
  365. tlog5 << "\t\tReading config/crerefnam.txt" << std::endl;
  366. //loading reference names
  367. std::ifstream ifs("config/crerefnam.txt");
  368. int tempi;
  369. std::string temps;
  370. for (;;)
  371. {
  372. ifs >> tempi >> temps;
  373. if (tempi>=creatures.size())
  374. break;
  375. boost::assign::insert(nameToID)(temps,tempi);
  376. creatures[tempi].nameRef=temps;
  377. }
  378. ifs.close();
  379. ifs.clear();
  380. for(int i=1;i<=10;i++)
  381. levelCreatures.insert(std::pair<int,std::vector<CCreature*> >(i,std::vector<CCreature*>()));
  382. tlog5 << "\t\tReading config/monsters.txt" << std::endl;
  383. ifs.open("config/monsters.txt");
  384. {
  385. while(!ifs.eof())
  386. {
  387. int id, lvl;
  388. ifs >> id >> lvl;
  389. if(lvl>0)
  390. {
  391. creatures[id].level = lvl;
  392. levelCreatures[lvl].push_back(&(creatures[id]));
  393. }
  394. }
  395. }
  396. ifs.close();
  397. ifs.clear();
  398. tlog5 << "\t\tReading config/cr_factions.txt" << std::endl;
  399. ifs.open("config/cr_factions.txt");
  400. while(!ifs.eof())
  401. {
  402. int id, fact;
  403. ifs >> id >> fact;
  404. creatures[id].faction = fact;
  405. }
  406. ifs.close();
  407. ifs.clear();
  408. tlog5 << "\t\tReading config/cr_upgrade_list.txt" << std::endl;
  409. ifs.open("config/cr_upgrade_list.txt");
  410. while(!ifs.eof())
  411. {
  412. int id, up;
  413. ifs >> id >> up;
  414. creatures[id].upgrades.insert(up);
  415. }
  416. ifs.close();
  417. ifs.clear();
  418. //loading unit animation def names
  419. tlog5 << "\t\tReading config/CREDEFS.TXT" << std::endl;
  420. std::ifstream inp("config/CREDEFS.TXT", std::ios::in | std::ios::binary); //this file is not in lod
  421. inp.seekg(0,std::ios::end); // na koniec
  422. int andame2 = inp.tellg(); // read length
  423. inp.seekg(0,std::ios::beg); // wracamy na poczatek
  424. char * bufor = new char[andame2+1]; // allocate memory
  425. inp.read((char*)bufor, andame2); // read map file to buffer
  426. inp.close();
  427. bufor[andame2] = 0;
  428. buf = std::string(bufor);
  429. delete [] bufor;
  430. i = 0; //buf iterator
  431. hmcr = 0;
  432. for(i; i<andame2; ++i) //omitting rubbish
  433. {
  434. if(buf[i]=='\r')
  435. break;
  436. }
  437. i+=2;
  438. tlog5 << "We have "<<creatures.size() << " creatures\n";
  439. for(int s=0; s<creatures.size(); ++s)
  440. {
  441. //tlog5 <<"\t\t\t" << s <<". Reading defname. \n";
  442. int befi=i;
  443. std::string rub;
  444. for(i; i<andame2; ++i)
  445. {
  446. if(buf[i]==' ')
  447. break;
  448. }
  449. rub = buf.substr(befi, i-befi);
  450. ++i;
  451. befi=i;
  452. for(i; i<andame2; ++i)
  453. {
  454. if(buf[i]=='\r')
  455. break;
  456. }
  457. std::string defName = buf.substr(befi, i-befi);
  458. creatures[s].animDefName = defName;
  459. }
  460. tlog5 << "\t\tReading CRANIM.TXT.txt" << std::endl;
  461. loadAnimationInfo();
  462. //loading id to projectile mapping
  463. tlog5 << "\t\tReading config/cr_shots.txt" << std::endl;
  464. std::ifstream inp2("config" PATHSEPARATOR "cr_shots.txt", std::ios::in | std::ios::binary); //this file is not in lod
  465. char dump [200];
  466. inp2.getline(dump, 200);
  467. while(true)
  468. {
  469. int id;
  470. std::string name;
  471. bool spin;
  472. inp2>>id;
  473. if(id == -1)
  474. break;
  475. inp2>>name;
  476. idToProjectile[id] = name;
  477. inp2>>spin;
  478. idToProjectileSpin[id] = spin;
  479. }
  480. inp2.close();
  481. }
  482. void CCreatureHandler::loadAnimationInfo()
  483. {
  484. std::string buf = bitmaph->getTextFile("CRANIM.TXT");
  485. int andame = buf.size();
  486. int i=0; //buf iterator
  487. int hmcr=0;
  488. for(i; i<andame; ++i)
  489. {
  490. if(buf[i]=='\r')
  491. ++hmcr;
  492. if(hmcr==2)
  493. break;
  494. }
  495. i+=2;
  496. for(int dd=0; dd<creatures.size(); ++dd)
  497. {
  498. //tlog5 << "\t\t\tReading animation info for creature " << dd << std::endl;
  499. loadUnitAnimInfo(creatures[dd], buf, i);
  500. }
  501. return;
  502. }
  503. void CCreatureHandler::loadUnitAnimInfo(CCreature & unit, std::string & src, int & i)
  504. {
  505. int befi=i;
  506. unit.timeBetweenFidgets = readFloat(befi, i, src.size(), src);
  507. while(unit.timeBetweenFidgets == 0.0)
  508. {
  509. for(i; i<src.size(); ++i)
  510. {
  511. if(src[i]=='\r')
  512. break;
  513. }
  514. i+=2;
  515. unit.timeBetweenFidgets = readFloat(befi, i, src.size(), src);
  516. }
  517. unit.walkAnimationTime = readFloat(befi, i, src.size(), src);
  518. unit.attackAnimationTime = readFloat(befi, i, src.size(), src);
  519. unit.flightAnimationDistance = readFloat(befi, i, src.size(), src);
  520. ///////////////////////
  521. unit.upperRightMissleOffsetX = readNumber(befi, i, src.size(), src);
  522. unit.upperRightMissleOffsetY = readNumber(befi, i, src.size(), src);
  523. unit.rightMissleOffsetX = readNumber(befi, i, src.size(), src);
  524. unit.rightMissleOffsetY = readNumber(befi, i, src.size(), src);
  525. unit.lowerRightMissleOffsetX = readNumber(befi, i, src.size(), src);
  526. unit.lowerRightMissleOffsetY = readNumber(befi, i, src.size(), src);
  527. ///////////////////////
  528. for(int jjj=0; jjj<12; ++jjj)
  529. {
  530. unit.missleFrameAngles[jjj] = readFloat(befi, i, src.size(), src);
  531. }
  532. unit.troopCountLocationOffset= readNumber(befi, i, src.size(), src);
  533. unit.attackClimaxFrame = readNumber(befi, i, src.size(), src);
  534. for(i; i<src.size(); ++i)
  535. {
  536. if(src[i]=='\r')
  537. break;
  538. }
  539. i+=2;
  540. }
  541. CCreatureHandler::~CCreatureHandler()
  542. {
  543. }