mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
More moving / minor changes
This commit is contained in:
parent
d251597617
commit
c7dde147c3
@ -177,11 +177,7 @@ void Graphics::loadHeroAnim(std::vector<CDefHandler **> & anims)
|
||||
for(int i=0; i<anims.size();i++)
|
||||
{
|
||||
std::stringstream nm;
|
||||
nm<<"AH";
|
||||
nm<<std::setw(2);
|
||||
nm<<std::setfill('0');
|
||||
nm<<i;
|
||||
nm<<"_.DEF";
|
||||
nm << "AH" << std::setw(2) << std::setfill('0') << i << "_.DEF";
|
||||
std::string name = nm.str();
|
||||
(*anims[i]) = CDefHandler::giveDef(name);
|
||||
int pom = 0; //how many groups has been rotated
|
||||
|
@ -264,10 +264,6 @@
|
||||
RelativePath="..\CAdvmapInterface.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CAmbarCendamo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CBattleInterface.cpp"
|
||||
>
|
||||
@ -276,10 +272,6 @@
|
||||
RelativePath=".\CBitmapHandler.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CBuildingHandler.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CCallback.cpp"
|
||||
>
|
||||
@ -380,10 +372,6 @@
|
||||
RelativePath=".\Graphics.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\map.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\mapHandler.cpp"
|
||||
>
|
||||
|
@ -1,12 +1,12 @@
|
||||
#define VCMI_DLL
|
||||
#include "../stdafx.h"
|
||||
#include "CAmbarCendamo.h"
|
||||
#include "../CGameInfo.h"
|
||||
#include "CObjectHandler.h"
|
||||
#include "CDefObjInfoHandler.h"
|
||||
#include <set>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include "../lib/VCMI_Lib.h"
|
||||
std::string nameFromType (EterrainType typ);
|
||||
int readInt(unsigned char * bufor, int bytCon)
|
||||
{
|
||||
@ -120,10 +120,11 @@ void CAmbarCendamo::deh3m()
|
||||
{
|
||||
THC timeHandler th;
|
||||
th.getDif();
|
||||
map.version = (Eformat)bufor[0]; //wersja mapy
|
||||
map.areAnyPLayers = bufor[4]; //invalid on some maps
|
||||
map.height = map.width = bufor[5]; // wymiary mapy
|
||||
map.twoLevel = bufor[9]; //czy sa lochy
|
||||
i=0;
|
||||
map.version = (Eformat)(readNormalNr(i)); i+=4; //map version
|
||||
map.areAnyPLayers = readChar(); //invalid on some maps
|
||||
map.height = map.width = (readNormalNr(i)); i+=4; // wymiary mapy
|
||||
map.twoLevel = readChar(); //czy sa lochy
|
||||
map.terrain = new TerrainTile*[map.width]; // allocate memory
|
||||
for (int ii=0;ii<map.width;ii++)
|
||||
map.terrain[ii] = new TerrainTile[map.height]; // allocate memory
|
||||
@ -133,23 +134,14 @@ void CAmbarCendamo::deh3m()
|
||||
for (int ii=0;ii<map.width;ii++)
|
||||
map.undergroungTerrain[ii] = new TerrainTile[map.height]; // allocate memory
|
||||
}
|
||||
int pom, length = bufor[10]; //name length
|
||||
i=14;
|
||||
while (i-14<length) //read name
|
||||
map.name+=bufor[i++];
|
||||
length = bufor[i] + bufor[i+1]*256; //description length
|
||||
i+=4;
|
||||
for (pom=0;pom<length;pom++)
|
||||
map.description+=bufor[i++];
|
||||
map.difficulty = bufor[i++]; // reading map difficulty
|
||||
int pom;
|
||||
map.name = readString();
|
||||
map.description= readString();
|
||||
map.difficulty = readChar(); // reading map difficulty
|
||||
if(map.version != Eformat::RoE)
|
||||
{
|
||||
map.levelLimit = bufor[i++]; // hero level limit
|
||||
}
|
||||
map.levelLimit = readChar(); // hero level limit
|
||||
else
|
||||
{
|
||||
map.levelLimit = 0;
|
||||
}
|
||||
for (pom=0;pom<8;pom++)
|
||||
{
|
||||
map.players[pom].canHumanPlay = bufor[i++];
|
||||
@ -1098,7 +1090,7 @@ void CAmbarCendamo::deh3m()
|
||||
{
|
||||
int creType = readNormalNr(i, 2); i+=2;
|
||||
int creNumb = readNormalNr(i, 2); i+=2;
|
||||
spec->m6cre.push_back(&(CGI->creh->creatures[creType]));
|
||||
spec->m6cre.push_back(&(VLC->creh->creatures[creType]));
|
||||
spec->m6number.push_back(creNumb);
|
||||
}
|
||||
int limit = readNormalNr(i); i+=4;
|
||||
@ -1830,7 +1822,7 @@ void CAmbarCendamo::deh3m()
|
||||
{
|
||||
int creType = readNormalNr(i, 2); i+=2;
|
||||
int creNumb = readNormalNr(i, 2); i+=2;
|
||||
spec->m6cre.push_back(&(CGI->creh->creatures[creType]));
|
||||
spec->m6cre.push_back(&(VLC->creh->creatures[creType]));
|
||||
spec->m6number.push_back(creNumb);
|
||||
}
|
||||
int limit = readNormalNr(i); i+=4;
|
||||
@ -2059,8 +2051,8 @@ CCreatureSet CAmbarCendamo::readCreatureSet(int number)
|
||||
int rettt = readNormalNr(i+ir*4, 2);
|
||||
if(rettt==0xffff) continue;
|
||||
if(rettt>32768)
|
||||
rettt = 65536-rettt+CGI->creh->creatures.size()-16;
|
||||
ins.first = &(CGI->creh->creatures[rettt]);
|
||||
rettt = 65536-rettt+VLC->creh->creatures.size()-16;
|
||||
ins.first = &(VLC->creh->creatures[rettt]);
|
||||
ins.second = readNormalNr(i+ir*4+2, 2);
|
||||
std::pair<int,std::pair<CCreature *, int> > tt(ir,ins);
|
||||
ret.slots.insert(tt);
|
||||
@ -2077,8 +2069,8 @@ CCreatureSet CAmbarCendamo::readCreatureSet(int number)
|
||||
int rettt = readNormalNr(i+ir*3, 1);
|
||||
if(rettt==0xff) continue;
|
||||
if(rettt>220)
|
||||
rettt = 256-rettt+CGI->creh->creatures.size()-16;
|
||||
ins.first = &(CGI->creh->creatures[rettt]);
|
||||
rettt = 256-rettt+VLC->creh->creatures.size()-16;
|
||||
ins.first = &(VLC->creh->creatures[rettt]);
|
||||
ins.second = readNormalNr(i+ir*3+1, 2);
|
||||
std::pair<int,std::pair<CCreature *, int> > tt(ir,ins);
|
||||
ret.slots.insert(tt);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
enum EDefType {TOWN_DEF, HERO_DEF, CREATURES_DEF, SEERHUT_DEF, RESOURCE_DEF, TERRAINOBJ_DEF, EVENTOBJ_DEF, SIGN_DEF, GARRISON_DEF, ARTIFACT_DEF, WITCHHUT_DEF, SCHOLAR_DEF, PLAYERONLY_DEF, SHRINE_DEF, SPELLSCROLL_DEF, PANDORA_DEF, GRAIL_DEF, CREGEN_DEF, CREGEN2_DEF, CREGEN3_DEF, BORDERGUARD_DEF, HEROPLACEHOLDER_DEF};
|
||||
|
||||
class CAmbarCendamo
|
||||
class DLL_EXPORT CAmbarCendamo
|
||||
{
|
||||
public:
|
||||
/////////////////member variables
|
||||
|
@ -1,9 +1,10 @@
|
||||
#define VCMI_DLL
|
||||
#include "../stdafx.h"
|
||||
#include "../CGameInfo.h"
|
||||
#include "CBuildingHandler.h"
|
||||
#include "CLodHandler.h"
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
extern CLodHandler * bitmaph;
|
||||
std::string readTo(std::string &in, unsigned int &it, char end)
|
||||
{
|
||||
int pom = it;
|
||||
@ -34,7 +35,7 @@ CBuilding * readBg(std::string &buf, unsigned int& it)
|
||||
}
|
||||
void CBuildingHandler::loadBuildings()
|
||||
{
|
||||
std::string buf = CGI->bitmaph->getTextFile("BUILDING.TXT"), temp;
|
||||
std::string buf = bitmaph->getTextFile("BUILDING.TXT"), temp;
|
||||
unsigned int andame = buf.size(), it=0; //buf iterator
|
||||
|
||||
temp = readTo(buf,it,'\n');temp = readTo(buf,it,'\n');//read 2 lines of file info
|
||||
@ -75,7 +76,7 @@ void CBuildingHandler::loadBuildings()
|
||||
}
|
||||
/////done reading BUILDING.TXT*****************************
|
||||
|
||||
buf = CGI->bitmaph->getTextFile("BLDGNEUT.TXT");
|
||||
buf = bitmaph->getTextFile("BLDGNEUT.TXT");
|
||||
andame = buf.size(), it=0;
|
||||
|
||||
for(int b=0;b<15;b++)
|
||||
@ -105,7 +106,7 @@ void CBuildingHandler::loadBuildings()
|
||||
}
|
||||
/////done reading "BLDGNEUT.TXT"******************************
|
||||
|
||||
buf = CGI->bitmaph->getTextFile("BLDGSPEC.TXT");
|
||||
buf = bitmaph->getTextFile("BLDGSPEC.TXT");
|
||||
andame = buf.size(), it=0;
|
||||
for(int f=0;f<F_NUMBER;f++)
|
||||
{
|
||||
@ -122,7 +123,7 @@ void CBuildingHandler::loadBuildings()
|
||||
}
|
||||
/////done reading BLDGSPEC.TXT*********************************
|
||||
|
||||
buf = CGI->bitmaph->getTextFile("DWELLING.TXT");
|
||||
buf = bitmaph->getTextFile("DWELLING.TXT");
|
||||
andame = buf.size(), it=0;
|
||||
for(int f=0;f<F_NUMBER;f++)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "../global.h"
|
||||
#include <map>
|
||||
//enum EbuildingType {NEUTRAL=-1, CASTLE, RAMPART, TOWER, INFERNO, NECROPOLIS, DUNGEON, STRONGHOLD, FORTRESS, CONFLUX};
|
||||
class CBuilding //a typical building encountered in every castle ;]
|
||||
class DLL_EXPORT CBuilding //a typical building encountered in every castle ;]
|
||||
{
|
||||
public:
|
||||
std::string name;
|
||||
@ -14,7 +14,7 @@ public:
|
||||
//bool isDwelling; //true, if this building is a dwelling
|
||||
};
|
||||
|
||||
class CBuildingHandler
|
||||
class DLL_EXPORT CBuildingHandler
|
||||
{
|
||||
public:
|
||||
std::map<int, std::map<int, CBuilding*> > buildings; ///< first int is the castle ID, second the building ID (in ERM-U format)
|
||||
|
@ -45,12 +45,6 @@ public:
|
||||
static int getQuantityID(int quantity); //0 - a few, 1 - several, 2 - pack, 3 - lots, 4 - horde, 5 - throng, 6 - swarm, 7 - zounds, 8 - legion
|
||||
};
|
||||
|
||||
class CCreatureSet //seven combined creatures
|
||||
{
|
||||
public:
|
||||
std::map<int,std::pair<CCreature*,int> > slots;
|
||||
bool formation; //false - wide, true - tight
|
||||
};
|
||||
|
||||
class DLL_EXPORT CCreatureHandler
|
||||
{
|
||||
|
@ -19,35 +19,8 @@ class CBuilding;
|
||||
class CSpell;
|
||||
class CGTownInstance;
|
||||
class CArtifact;
|
||||
class DLL_EXPORT CSpecObjInfo //class with object - specific info (eg. different information for creatures and heroes); use inheritance to make object - specific classes
|
||||
{
|
||||
};
|
||||
|
||||
class DLL_EXPORT CEventObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
bool areGuarders; //true if there are
|
||||
CCreatureSet guarders;
|
||||
bool isMessage; //true if there is a message
|
||||
std::string message;
|
||||
unsigned int gainedExp;
|
||||
int manaDiff; //amount of gained / lost mana
|
||||
int moraleDiff; //morale modifier
|
||||
int luckDiff; //luck modifier
|
||||
int wood, mercury, ore, sulfur, crystal, gems, gold; //gained / lost resources
|
||||
unsigned int attack; //added attack points
|
||||
unsigned int defence; //added defence points
|
||||
unsigned int power; //added power points
|
||||
unsigned int knowledge; //added knowledge points
|
||||
std::vector<int> abilities; //gained abilities
|
||||
std::vector<int> abilityLevels; //levels of gained abilities
|
||||
std::vector<int> artifacts; //gained artifacts
|
||||
std::vector<int> spells; //gained spells
|
||||
CCreatureSet creatures; //gained creatures
|
||||
unsigned char availableFor; //players whom this event is available for
|
||||
bool computerActivate; //true if computre player can activate this event
|
||||
bool humanActivate; //true if human player can activate this event
|
||||
};
|
||||
class CGDefInfo;
|
||||
class CSpecObjInfo;
|
||||
|
||||
class DLL_EXPORT CCastleEvent
|
||||
{
|
||||
@ -69,224 +42,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class DLL_EXPORT CCreatureObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char bytes[4]; //mysterious bytes identifying creature
|
||||
unsigned int number; //number of units (0 - random)
|
||||
unsigned char character; //chracter of this set of creatures (0 - the most friendly, 4 - the most hostile)
|
||||
std::string message; //message printed for attacking hero
|
||||
int wood, mercury, ore, sulfur, crytal, gems, gold; //resources gained to hero that has won with monsters
|
||||
int gainedArtifact; //ID of artifact gained to hero
|
||||
bool neverFlees; //if true, the troops will never flee
|
||||
bool notGrowingTeam; //if true, number of units won't grow
|
||||
};
|
||||
|
||||
class DLL_EXPORT CSignObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::string message; //message
|
||||
};
|
||||
|
||||
class DLL_EXPORT CSeerHutObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char missionType; //type of mission: 0 - no mission; 1 - reach level; 2 - reach main statistics values; 3 - win with a certain hero; 4 - win with a certain creature; 5 - collect some atifacts; 6 - have certain troops in army; 7 - collect resources; 8 - be a certain hero; 9 - be a certain player
|
||||
bool isDayLimit; //if true, there is a day limit
|
||||
int lastDay; //after this day (first day is 0) mission cannot be completed
|
||||
int m1level; //for mission 1
|
||||
int m2attack, m2defence, m2power, m2knowledge;//for mission 2
|
||||
unsigned char m3bytes[4];//for mission 3
|
||||
unsigned char m4bytes[4];//for mission 4
|
||||
std::vector<int> m5arts;//for mission 5 - artifact ID
|
||||
std::vector<CCreature *> m6cre;//for mission 6
|
||||
std::vector<int> m6number;
|
||||
int m7wood, m7mercury, m7ore, m7sulfur, m7crystal, m7gems, m7gold; //for mission 7
|
||||
int m8hero;//for mission 8 - hero ID
|
||||
int m9player; //for mission 9 - number; from 0 to 7
|
||||
|
||||
std::string firstVisitText, nextVisitText, completedText;
|
||||
|
||||
char rewardType; //type of reward: 0 - no reward; 1 - experience; 2 - mana points; 3 - morale bonus; 4 - luck bonus; 5 - resources; 6 - main ability bonus (attak, defence etd.); 7 - secondary ability gain; 8 - artifact; 9 - spell; 10 - creature
|
||||
//for reward 1
|
||||
int r1exp;
|
||||
//for reward 2
|
||||
int r2mana;
|
||||
//for reward 3
|
||||
int r3morale;
|
||||
//for reward 4
|
||||
int r4luck;
|
||||
//for reward 5
|
||||
unsigned char r5type; //0 - wood, 1 - mercury, 2 - ore, 3 - sulfur, 4 - crystal, 5 - gems, 6 - gold
|
||||
int r5amount;
|
||||
//for reward 6
|
||||
unsigned char r6type; //0 - attack, 1 - defence, 2 - power, 3 - knowledge
|
||||
int r6amount;
|
||||
//for reward 7
|
||||
int r7ability; //ability id
|
||||
unsigned char r7level; //1 - basic, 2 - advanced, 3 - expert
|
||||
//for reward 8
|
||||
int r8art;//artifact id
|
||||
//for reward 9
|
||||
int r9spell;//spell id
|
||||
//for reward 10
|
||||
int r10creature; //creature id
|
||||
int r10amount;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CWitchHutObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::vector<int> allowedAbilities;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CScholarObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char bonusType; //255 - random, 0 - primary skill, 1 - secondary skill, 2 - spell
|
||||
|
||||
unsigned char r0type;
|
||||
int r1; //Ability ID
|
||||
int r2; //Spell ID
|
||||
};
|
||||
|
||||
class DLL_EXPORT CGarrisonObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //255 - nobody; 0 - 7 - players
|
||||
CCreatureSet units;
|
||||
bool movableUnits; //if true, units can be moved
|
||||
};
|
||||
|
||||
class DLL_EXPORT CArtifactObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
bool areGuards;
|
||||
std::string message;
|
||||
CCreatureSet guards;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CResourceObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
bool randomAmount;
|
||||
int amount; //if not random
|
||||
bool areGuards;
|
||||
CCreatureSet guards;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CPlayerOnlyObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //FF - nobody, 0 - 7
|
||||
};
|
||||
|
||||
class DLL_EXPORT CShrineObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char spell; //number of spell or 255
|
||||
};
|
||||
|
||||
class DLL_EXPORT CSpellScrollObjinfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::string message;
|
||||
int spell;
|
||||
bool areGuarders;
|
||||
CCreatureSet guarders;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CPandorasBoxObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::string message;
|
||||
bool areGuarders;
|
||||
CCreatureSet guarders;
|
||||
|
||||
//gained things:
|
||||
unsigned int gainedExp;
|
||||
int manaDiff;
|
||||
int moraleDiff;
|
||||
int luckDiff;
|
||||
int wood, mercury, ore, sulfur, crystal, gems, gold;
|
||||
int attack, defence, power, knowledge;
|
||||
std::vector<int> abilities;
|
||||
std::vector<int> abilityLevels;
|
||||
std::vector<int> artifacts;
|
||||
std::vector<int> spells;
|
||||
CCreatureSet creatures;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CGrailObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
int radius; //place grail at the distance lesser or equal radius from this place
|
||||
};
|
||||
|
||||
class DLL_EXPORT CCreGenObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //owner
|
||||
bool asCastle;
|
||||
int identifier;
|
||||
unsigned char castles[2]; //allowed castles
|
||||
};
|
||||
|
||||
class DLL_EXPORT CCreGen2ObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //owner
|
||||
bool asCastle;
|
||||
int identifier;
|
||||
unsigned char castles[2]; //allowed castles
|
||||
unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6>
|
||||
};
|
||||
|
||||
class DLL_EXPORT CCreGen3ObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //owner
|
||||
unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6>
|
||||
};
|
||||
|
||||
class DLL_EXPORT CBorderGuardObjInfo : public CSpecObjInfo //copied form seer huts, seems to be similar
|
||||
{
|
||||
public:
|
||||
char missionType; //type of mission: 0 - no mission; 1 - reach level; 2 - reach main statistics values; 3 - win with a certain hero; 4 - win with a certain creature; 5 - collect some atifacts; 6 - have certain troops in army; 7 - collect resources; 8 - be a certain hero; 9 - be a certain player
|
||||
bool isDayLimit; //if true, there is a day limit
|
||||
int lastDay; //after this day (first day is 0) mission cannot be completed
|
||||
//for mission 1
|
||||
int m1level;
|
||||
//for mission 2
|
||||
int m2attack, m2defence, m2power, m2knowledge;
|
||||
//for mission 3
|
||||
unsigned char m3bytes[4];
|
||||
//for mission 4
|
||||
unsigned char m4bytes[4];
|
||||
//for mission 5
|
||||
std::vector<int> m5arts; //artifacts id
|
||||
//for mission 6
|
||||
std::vector<CCreature *> m6cre;
|
||||
std::vector<int> m6number;
|
||||
//for mission 7
|
||||
int m7wood, m7mercury, m7ore, m7sulfur, m7crystal, m7gems, m7gold;
|
||||
//for mission 8
|
||||
int m8hero; //hero id
|
||||
//for mission 9
|
||||
int m9player; //number; from 0 to 7
|
||||
|
||||
std::string firstVisitText, nextVisitText, completedText;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CObject //typical object that can be encountered on a map
|
||||
{
|
||||
public:
|
||||
std::string name; //object's name
|
||||
};
|
||||
|
||||
class DLL_EXPORT CGDefInfo;
|
||||
|
||||
class DLL_EXPORT CGObjectInstance
|
||||
{
|
||||
public:
|
||||
|
8
int3.h
8
int3.h
@ -1,5 +1,13 @@
|
||||
#ifndef INT3_H
|
||||
#define INT3_H
|
||||
#include <map>
|
||||
class CCreature;
|
||||
class CCreatureSet //seven combined creatures
|
||||
{
|
||||
public:
|
||||
std::map<int,std::pair<CCreature*,int> > slots;
|
||||
bool formation; //false - wide, true - tight
|
||||
};
|
||||
|
||||
class int3
|
||||
{
|
||||
|
@ -329,10 +329,18 @@
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\hch\CAmbarCendamo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CArtHandler.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CBuildingHandler.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CCreatureHandler.cpp"
|
||||
>
|
||||
@ -357,6 +365,10 @@
|
||||
RelativePath="..\hch\CTownHandler.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\map.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\stdafx.cpp"
|
||||
>
|
||||
@ -371,10 +383,18 @@
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\hch\CAmbarCendamo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CArtHandler.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CBuildingHandler.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\hch\CCreatureHandler.h"
|
||||
>
|
||||
@ -399,17 +419,15 @@
|
||||
RelativePath="..\hch\CTownHandler.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\map.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VCMI_Lib.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
272
map.h
272
map.h
@ -10,12 +10,236 @@ class CGObjectInstance;
|
||||
class CGHeroInstance;
|
||||
class CGTownInstance;
|
||||
enum ESortBy{name,playerAm,size,format, viccon,loscon};
|
||||
struct Sresource
|
||||
|
||||
class DLL_EXPORT CSpecObjInfo //class with object - specific info (eg. different information for creatures and heroes); use inheritance to make object - specific classes
|
||||
{
|
||||
};
|
||||
class DLL_EXPORT CEventObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
bool areGuarders; //true if there are
|
||||
CCreatureSet guarders;
|
||||
bool isMessage; //true if there is a message
|
||||
std::string message;
|
||||
unsigned int gainedExp;
|
||||
int manaDiff; //amount of gained / lost mana
|
||||
int moraleDiff; //morale modifier
|
||||
int luckDiff; //luck modifier
|
||||
int wood, mercury, ore, sulfur, crystal, gems, gold; //gained / lost resources
|
||||
unsigned int attack; //added attack points
|
||||
unsigned int defence; //added defence points
|
||||
unsigned int power; //added power points
|
||||
unsigned int knowledge; //added knowledge points
|
||||
std::vector<int> abilities; //gained abilities
|
||||
std::vector<int> abilityLevels; //levels of gained abilities
|
||||
std::vector<int> artifacts; //gained artifacts
|
||||
std::vector<int> spells; //gained spells
|
||||
CCreatureSet creatures; //gained creatures
|
||||
unsigned char availableFor; //players whom this event is available for
|
||||
bool computerActivate; //true if computre player can activate this event
|
||||
bool humanActivate; //true if human player can activate this event
|
||||
};
|
||||
class DLL_EXPORT CCreatureObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char bytes[4]; //mysterious bytes identifying creature
|
||||
unsigned int number; //number of units (0 - random)
|
||||
unsigned char character; //chracter of this set of creatures (0 - the most friendly, 4 - the most hostile)
|
||||
std::string message; //message printed for attacking hero
|
||||
int wood, mercury, ore, sulfur, crytal, gems, gold; //resources gained to hero that has won with monsters
|
||||
int gainedArtifact; //ID of artifact gained to hero
|
||||
bool neverFlees; //if true, the troops will never flee
|
||||
bool notGrowingTeam; //if true, number of units won't grow
|
||||
};
|
||||
class DLL_EXPORT CSignObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::string message; //message
|
||||
};
|
||||
class DLL_EXPORT CSeerHutObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char missionType; //type of mission: 0 - no mission; 1 - reach level; 2 - reach main statistics values; 3 - win with a certain hero; 4 - win with a certain creature; 5 - collect some atifacts; 6 - have certain troops in army; 7 - collect resources; 8 - be a certain hero; 9 - be a certain player
|
||||
bool isDayLimit; //if true, there is a day limit
|
||||
int lastDay; //after this day (first day is 0) mission cannot be completed
|
||||
int m1level; //for mission 1
|
||||
int m2attack, m2defence, m2power, m2knowledge;//for mission 2
|
||||
unsigned char m3bytes[4];//for mission 3
|
||||
unsigned char m4bytes[4];//for mission 4
|
||||
std::vector<int> m5arts;//for mission 5 - artifact ID
|
||||
std::vector<CCreature *> m6cre;//for mission 6
|
||||
std::vector<int> m6number;
|
||||
int m7wood, m7mercury, m7ore, m7sulfur, m7crystal, m7gems, m7gold; //for mission 7
|
||||
int m8hero;//for mission 8 - hero ID
|
||||
int m9player; //for mission 9 - number; from 0 to 7
|
||||
|
||||
std::string firstVisitText, nextVisitText, completedText;
|
||||
|
||||
char rewardType; //type of reward: 0 - no reward; 1 - experience; 2 - mana points; 3 - morale bonus; 4 - luck bonus; 5 - resources; 6 - main ability bonus (attak, defence etd.); 7 - secondary ability gain; 8 - artifact; 9 - spell; 10 - creature
|
||||
//for reward 1
|
||||
int r1exp;
|
||||
//for reward 2
|
||||
int r2mana;
|
||||
//for reward 3
|
||||
int r3morale;
|
||||
//for reward 4
|
||||
int r4luck;
|
||||
//for reward 5
|
||||
unsigned char r5type; //0 - wood, 1 - mercury, 2 - ore, 3 - sulfur, 4 - crystal, 5 - gems, 6 - gold
|
||||
int r5amount;
|
||||
//for reward 6
|
||||
unsigned char r6type; //0 - attack, 1 - defence, 2 - power, 3 - knowledge
|
||||
int r6amount;
|
||||
//for reward 7
|
||||
int r7ability; //ability id
|
||||
unsigned char r7level; //1 - basic, 2 - advanced, 3 - expert
|
||||
//for reward 8
|
||||
int r8art;//artifact id
|
||||
//for reward 9
|
||||
int r9spell;//spell id
|
||||
//for reward 10
|
||||
int r10creature; //creature id
|
||||
int r10amount;
|
||||
};
|
||||
class DLL_EXPORT CWitchHutObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::vector<int> allowedAbilities;
|
||||
};
|
||||
class DLL_EXPORT CScholarObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char bonusType; //255 - random, 0 - primary skill, 1 - secondary skill, 2 - spell
|
||||
|
||||
unsigned char r0type;
|
||||
int r1; //Ability ID
|
||||
int r2; //Spell ID
|
||||
};
|
||||
class DLL_EXPORT CGarrisonObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //255 - nobody; 0 - 7 - players
|
||||
CCreatureSet units;
|
||||
bool movableUnits; //if true, units can be moved
|
||||
};
|
||||
class DLL_EXPORT CArtifactObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
bool areGuards;
|
||||
std::string message;
|
||||
CCreatureSet guards;
|
||||
};
|
||||
class DLL_EXPORT CResourceObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
bool randomAmount;
|
||||
int amount; //if not random
|
||||
bool areGuards;
|
||||
CCreatureSet guards;
|
||||
std::string message;
|
||||
};
|
||||
class DLL_EXPORT CPlayerOnlyObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //FF - nobody, 0 - 7
|
||||
};
|
||||
class DLL_EXPORT CShrineObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char spell; //number of spell or 255
|
||||
};
|
||||
class DLL_EXPORT CSpellScrollObjinfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::string message;
|
||||
int spell;
|
||||
bool areGuarders;
|
||||
CCreatureSet guarders;
|
||||
};
|
||||
class DLL_EXPORT CPandorasBoxObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
std::string message;
|
||||
bool areGuarders;
|
||||
CCreatureSet guarders;
|
||||
|
||||
//gained things:
|
||||
unsigned int gainedExp;
|
||||
int manaDiff;
|
||||
int moraleDiff;
|
||||
int luckDiff;
|
||||
int wood, mercury, ore, sulfur, crystal, gems, gold;
|
||||
int attack, defence, power, knowledge;
|
||||
std::vector<int> abilities;
|
||||
std::vector<int> abilityLevels;
|
||||
std::vector<int> artifacts;
|
||||
std::vector<int> spells;
|
||||
CCreatureSet creatures;
|
||||
};
|
||||
|
||||
class DLL_EXPORT CGrailObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
int radius; //place grail at the distance lesser or equal radius from this place
|
||||
};
|
||||
class DLL_EXPORT CCreGenObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //owner
|
||||
bool asCastle;
|
||||
int identifier;
|
||||
unsigned char castles[2]; //allowed castles
|
||||
};
|
||||
class DLL_EXPORT CCreGen2ObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //owner
|
||||
bool asCastle;
|
||||
int identifier;
|
||||
unsigned char castles[2]; //allowed castles
|
||||
unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6>
|
||||
};
|
||||
class DLL_EXPORT CCreGen3ObjInfo : public CSpecObjInfo
|
||||
{
|
||||
public:
|
||||
unsigned char player; //owner
|
||||
unsigned char minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <0, 6>
|
||||
};
|
||||
class DLL_EXPORT CBorderGuardObjInfo : public CSpecObjInfo //copied form seer huts, seems to be similar
|
||||
{
|
||||
public:
|
||||
char missionType; //type of mission: 0 - no mission; 1 - reach level; 2 - reach main statistics values; 3 - win with a certain hero; 4 - win with a certain creature; 5 - collect some atifacts; 6 - have certain troops in army; 7 - collect resources; 8 - be a certain hero; 9 - be a certain player
|
||||
bool isDayLimit; //if true, there is a day limit
|
||||
int lastDay; //after this day (first day is 0) mission cannot be completed
|
||||
//for mission 1
|
||||
int m1level;
|
||||
//for mission 2
|
||||
int m2attack, m2defence, m2power, m2knowledge;
|
||||
//for mission 3
|
||||
unsigned char m3bytes[4];
|
||||
//for mission 4
|
||||
unsigned char m4bytes[4];
|
||||
//for mission 5
|
||||
std::vector<int> m5arts; //artifacts id
|
||||
//for mission 6
|
||||
std::vector<CCreature *> m6cre;
|
||||
std::vector<int> m6number;
|
||||
//for mission 7
|
||||
int m7wood, m7mercury, m7ore, m7sulfur, m7crystal, m7gems, m7gold;
|
||||
//for mission 8
|
||||
int m8hero; //hero id
|
||||
//for mission 9
|
||||
int m9player; //number; from 0 to 7
|
||||
|
||||
std::string firstVisitText, nextVisitText, completedText;
|
||||
};
|
||||
|
||||
struct DLL_EXPORT Sresource
|
||||
{
|
||||
std::string resName; //name of this resource
|
||||
int amount; //it can be greater and lesser than 0
|
||||
};
|
||||
struct TimeEvent
|
||||
struct DLL_EXPORT TimeEvent
|
||||
{
|
||||
std::string eventName;
|
||||
std::string message;
|
||||
@ -26,7 +250,7 @@ struct TimeEvent
|
||||
int firstAfterNDays; //how many days after appears this event
|
||||
int nextAfterNDays; //how many days after the epperance before appaers this event
|
||||
};
|
||||
struct TerrainTile
|
||||
struct DLL_EXPORT TerrainTile
|
||||
{
|
||||
EterrainType tertype; // type of terrain
|
||||
unsigned char terview; // look of terrain
|
||||
@ -34,14 +258,14 @@ struct TerrainTile
|
||||
unsigned char rivDir; // direction of Eriver
|
||||
Eroad malle; // type of Eroad (0 if there is no Eriver)
|
||||
unsigned char roadDir; // direction of Eroad
|
||||
unsigned char siodmyTajemniczyBajt; // mysterius byte // jak bedzie waidomo co to, to sie nazwie inaczej
|
||||
unsigned char siodmyTajemniczyBajt; //bitfield, info whether this tile is coastal and how to rotate tile graphics
|
||||
};
|
||||
struct SheroName //name of starting hero
|
||||
struct DLL_EXPORT SheroName //name of starting hero
|
||||
{
|
||||
int heroID;
|
||||
std::string heroName;
|
||||
};
|
||||
struct PlayerInfo
|
||||
struct DLL_EXPORT PlayerInfo
|
||||
{
|
||||
int p7, p8, p9;
|
||||
bool canHumanPlay;
|
||||
@ -58,66 +282,66 @@ struct PlayerInfo
|
||||
int team;
|
||||
bool generateHero;
|
||||
};
|
||||
struct LossCondition
|
||||
struct DLL_EXPORT LossCondition
|
||||
{
|
||||
ElossCon typeOfLossCon;
|
||||
int3 castlePos;
|
||||
int3 heroPos;
|
||||
int timeLimit; // in days
|
||||
};
|
||||
struct CspecificVictoryConidtions
|
||||
struct DLL_EXPORT CspecificVictoryConidtions
|
||||
{
|
||||
bool allowNormalVictory;
|
||||
bool appliesToAI;
|
||||
};
|
||||
struct VicCon0 : public CspecificVictoryConidtions //acquire artifact
|
||||
struct DLL_EXPORT VicCon0 : public CspecificVictoryConidtions //acquire artifact
|
||||
{
|
||||
int ArtifactID;
|
||||
};
|
||||
struct VicCon1 : public CspecificVictoryConidtions //accumulate creatures
|
||||
struct DLL_EXPORT VicCon1 : public CspecificVictoryConidtions //accumulate creatures
|
||||
{
|
||||
int monsterID;
|
||||
int neededQuantity;
|
||||
};
|
||||
struct VicCon2 : public CspecificVictoryConidtions // accumulate resources
|
||||
struct DLL_EXPORT VicCon2 : public CspecificVictoryConidtions // accumulate resources
|
||||
{
|
||||
int resourceID;
|
||||
int neededQuantity;
|
||||
};
|
||||
struct VicCon3 : public CspecificVictoryConidtions // upgrade specific town
|
||||
struct DLL_EXPORT VicCon3 : public CspecificVictoryConidtions // upgrade specific town
|
||||
{
|
||||
int3 posOfCity;
|
||||
int councilNeededLevel; //0 - town; 1 - city; 2 - capitol
|
||||
int fortNeededLevel;// 0 - fort; 1 - citadel; 2 - castle
|
||||
};
|
||||
struct VicCon4 : public CspecificVictoryConidtions // build grail structure
|
||||
struct DLL_EXPORT VicCon4 : public CspecificVictoryConidtions // build grail structure
|
||||
{
|
||||
bool anyLocation;
|
||||
int3 whereBuildGrail;
|
||||
};
|
||||
struct VicCon5 : public CspecificVictoryConidtions // defeat a specific hero
|
||||
struct DLL_EXPORT VicCon5 : public CspecificVictoryConidtions // defeat a specific hero
|
||||
{
|
||||
int3 locationOfHero;
|
||||
};
|
||||
struct VicCon6 : public CspecificVictoryConidtions // capture a specific town
|
||||
struct DLL_EXPORT VicCon6 : public CspecificVictoryConidtions // capture a specific town
|
||||
{
|
||||
int3 locationOfTown;
|
||||
};
|
||||
struct VicCon7 : public CspecificVictoryConidtions // defeat a specific monster
|
||||
struct DLL_EXPORT VicCon7 : public CspecificVictoryConidtions // defeat a specific monster
|
||||
{
|
||||
int3 locationOfMonster;
|
||||
};
|
||||
struct VicCona : public CspecificVictoryConidtions //transport specific artifact
|
||||
struct DLL_EXPORT VicCona : public CspecificVictoryConidtions //transport specific artifact
|
||||
{
|
||||
int artifactID;
|
||||
int3 destinationPlace;
|
||||
};
|
||||
struct Rumor
|
||||
struct DLL_EXPORT Rumor
|
||||
{
|
||||
std::string name, text;
|
||||
};
|
||||
|
||||
struct DisposedHero
|
||||
struct DLL_EXPORT DisposedHero
|
||||
{
|
||||
int ID;
|
||||
int portrait; //0xFF - default
|
||||
@ -125,7 +349,7 @@ struct DisposedHero
|
||||
bool players[8]; //who can hire this hero
|
||||
};
|
||||
|
||||
class CMapEvent
|
||||
class DLL_EXPORT CMapEvent
|
||||
{
|
||||
public:
|
||||
std::string name, message;
|
||||
@ -136,7 +360,7 @@ public:
|
||||
int firstOccurence;
|
||||
int nextOccurence; //after nextOccurance day event will occure; if it it 0, event occures only one time;
|
||||
};
|
||||
struct Mapa
|
||||
struct DLL_EXPORT Mapa
|
||||
{
|
||||
Eformat version; // version of map Eformat
|
||||
int twoLevel; // if map has underground level
|
||||
@ -168,7 +392,7 @@ struct Mapa
|
||||
std::vector<CGHeroInstance*> heroes;
|
||||
std::vector<CGTownInstance*> towns;
|
||||
};
|
||||
class CMapHeader
|
||||
class DLL_EXPORT CMapHeader
|
||||
{
|
||||
public:
|
||||
Eformat version; // version of map Eformat
|
||||
@ -187,7 +411,7 @@ public:
|
||||
int howManyTeams;
|
||||
CMapHeader(unsigned char *map); //an argument is a reference to string described a map (unpacked)
|
||||
};
|
||||
class CMapInfo : public CMapHeader
|
||||
class DLL_EXPORT CMapInfo : public CMapHeader
|
||||
{
|
||||
public:
|
||||
std::string filename;
|
||||
@ -204,7 +428,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class mapSorter
|
||||
class DLL_EXPORT mapSorter
|
||||
{
|
||||
public:
|
||||
ESortBy sortBy;
|
||||
|
Loading…
Reference in New Issue
Block a user