1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

More moving / minor changes

This commit is contained in:
Michał W. Urbańczyk
2008-06-19 06:08:05 +00:00
parent d251597617
commit c7dde147c3
12 changed files with 311 additions and 328 deletions

272
map.h
View File

@@ -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;