2008-01-09 19:21:31 +02:00
|
|
|
#include "../stdafx.h"
|
2007-06-07 23:16:19 +03:00
|
|
|
#include "CArtHandler.h"
|
2007-08-30 13:11:53 +03:00
|
|
|
#include "../CGameInfo.h"
|
2007-08-04 22:01:22 +03:00
|
|
|
#include "CGeneralTextHandler.h"
|
2007-08-29 15:18:31 +03:00
|
|
|
#include "CLodHandler.h"
|
2007-06-07 23:16:19 +03:00
|
|
|
|
|
|
|
void CArtHandler::loadArtifacts()
|
|
|
|
{
|
2008-01-19 15:19:58 +02:00
|
|
|
artDefs = CGI->spriteh->giveDef("ARTIFACT.DEF");
|
|
|
|
|
2007-08-04 22:01:22 +03:00
|
|
|
std::string buf = CGameInfo::mainObj->bitmaph->getTextFile("ARTRAITS.TXT");
|
|
|
|
int it=0;
|
2007-06-07 23:16:19 +03:00
|
|
|
std::string dump;
|
2007-08-04 22:01:22 +03:00
|
|
|
for(int i=0; i<2; ++i)
|
2007-06-07 23:16:19 +03:00
|
|
|
{
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(dump,buf,it,3);
|
2007-06-07 23:16:19 +03:00
|
|
|
}
|
2007-08-04 22:01:22 +03:00
|
|
|
for (int i=0; i<ARTIFACTS_QUANTITY; i++)
|
2007-06-07 23:16:19 +03:00
|
|
|
{
|
|
|
|
CArtifact nart;
|
2007-08-04 22:01:22 +03:00
|
|
|
std::string pom;
|
|
|
|
CGeneralTextHandler::loadToIt(nart.name,buf,it,4);
|
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
|
|
|
nart.price=atoi(pom.c_str());
|
|
|
|
|
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.spellBook=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.spellBook = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.warMachine4=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.warMachine4 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.warMachine3=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.warMachine3 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.warMachine2=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.warMachine2 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.warMachine1=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.warMachine1 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.misc5=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.misc5 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.misc4=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.misc4 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.misc3=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.misc3 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.misc2=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.misc2 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.misc1=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.misc1 = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.feet=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.feet = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.lRing=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.lRing = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.rRing=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.rRing = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.torso=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.torso = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.lHand=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.lHand = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.rHand=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.rHand = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.neck=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.neck = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.shoulders=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.shoulders = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
2008-01-30 12:55:43 +02:00
|
|
|
if (pom[0]=='x')
|
2007-08-04 22:01:22 +03:00
|
|
|
nart.head=true;
|
2008-01-30 12:55:43 +02:00
|
|
|
else
|
|
|
|
nart.head = false;
|
2007-08-04 22:01:22 +03:00
|
|
|
|
|
|
|
CGeneralTextHandler::loadToIt(pom,buf,it,4);
|
|
|
|
switch (pom[0])
|
2007-06-07 23:16:19 +03:00
|
|
|
{
|
2007-08-04 22:01:22 +03:00
|
|
|
case 'S':
|
2007-12-23 18:25:14 +02:00
|
|
|
nart.aClass=SartClass;
|
2007-06-07 23:16:19 +03:00
|
|
|
break;
|
2007-08-04 22:01:22 +03:00
|
|
|
case 'T':
|
2007-12-23 18:25:14 +02:00
|
|
|
nart.aClass=TartClass;
|
2007-06-07 23:16:19 +03:00
|
|
|
break;
|
2007-08-04 22:01:22 +03:00
|
|
|
case 'N':
|
2007-12-23 18:25:14 +02:00
|
|
|
nart.aClass=NartClass;
|
2007-06-07 23:16:19 +03:00
|
|
|
break;
|
2007-08-04 22:01:22 +03:00
|
|
|
case 'J':
|
2007-12-23 18:25:14 +02:00
|
|
|
nart.aClass=JartClass;
|
2007-06-07 23:16:19 +03:00
|
|
|
break;
|
2007-08-04 22:01:22 +03:00
|
|
|
case 'R':
|
2007-12-23 18:25:14 +02:00
|
|
|
nart.aClass=RartClass;
|
2007-06-07 23:16:19 +03:00
|
|
|
break;
|
|
|
|
}
|
2007-08-04 22:01:22 +03:00
|
|
|
CGeneralTextHandler::loadToIt(nart.description,buf,it,3);
|
|
|
|
nart.id=artifacts.size();
|
2007-06-08 17:58:04 +03:00
|
|
|
|
2007-08-04 22:01:22 +03:00
|
|
|
artifacts.push_back(nart);
|
2007-06-07 23:16:19 +03:00
|
|
|
}
|
2008-02-05 05:56:45 +02:00
|
|
|
for(int i=0;i<144;i++) //do 144, bo nie chcemy bzdurek
|
|
|
|
{
|
|
|
|
switch (artifacts[i].aClass)
|
|
|
|
{
|
|
|
|
case TartClass:
|
|
|
|
treasures.push_back(&(artifacts[i]));
|
|
|
|
break;
|
|
|
|
case NartClass:
|
|
|
|
minors.push_back(&(artifacts[i]));
|
|
|
|
break;
|
|
|
|
case JartClass:
|
|
|
|
majors.push_back(&(artifacts[i]));
|
|
|
|
break;
|
|
|
|
case RartClass:
|
|
|
|
relics.push_back(&(artifacts[i]));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-06-08 17:58:04 +03:00
|
|
|
}
|