2011-12-14 00:35:28 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/*
|
|
|
|
* GameConstants.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
#include "ConstTransitivePtr.h"
|
|
|
|
|
2011-12-14 00:35:28 +03:00
|
|
|
namespace GameConstants
|
|
|
|
{
|
2016-03-01 20:42:40 +02:00
|
|
|
const std::string VCMI_VERSION = "VCMI 0.98h";
|
2011-12-14 00:35:28 +03:00
|
|
|
|
|
|
|
const int BFIELD_WIDTH = 17;
|
|
|
|
const int BFIELD_HEIGHT = 11;
|
|
|
|
const int BFIELD_SIZE = BFIELD_WIDTH * BFIELD_HEIGHT;
|
|
|
|
|
2013-03-02 19:55:51 +03:00
|
|
|
const int PUZZLE_MAP_PIECES = 48;
|
2011-12-14 00:35:28 +03:00
|
|
|
|
2012-03-13 15:47:47 +03:00
|
|
|
const int MAX_HEROES_PER_PLAYER = 8;
|
2013-03-02 19:55:51 +03:00
|
|
|
const int AVAILABLE_HEROES_PER_PLAYER = 2;
|
|
|
|
|
|
|
|
const int ALL_PLAYERS = 255; //bitfield
|
|
|
|
|
|
|
|
const ui16 BACKPACK_START = 19;
|
2011-12-14 00:35:28 +03:00
|
|
|
const int CREATURES_PER_TOWN = 7; //without upgrades
|
|
|
|
const int SPELL_LEVELS = 5;
|
2013-05-19 18:14:23 +03:00
|
|
|
const int SPELL_SCHOOL_LEVELS = 4;
|
2013-03-02 21:41:25 +03:00
|
|
|
const int CRE_LEVELS = 10; // number of creature experience levels
|
2011-12-14 00:35:28 +03:00
|
|
|
|
2015-12-06 23:13:58 +02:00
|
|
|
const int HERO_GOLD_COST = 2500;
|
2013-03-02 19:55:51 +03:00
|
|
|
const int SPELLBOOK_GOLD_COST = 500;
|
2012-09-20 19:55:21 +03:00
|
|
|
const int BATTLE_PENALTY_DISTANCE = 10; //if the distance is > than this, then shooting stack has distance penalty
|
2013-03-02 19:55:51 +03:00
|
|
|
const int ARMY_SIZE = 7;
|
|
|
|
const int SKILL_PER_HERO=8;
|
2012-09-20 19:55:21 +03:00
|
|
|
|
2013-03-02 19:55:51 +03:00
|
|
|
const int SKILL_QUANTITY=28;
|
|
|
|
const int PRIMARY_SKILLS=4;
|
2012-09-05 15:49:23 +03:00
|
|
|
const int TERRAIN_TYPES=10;
|
|
|
|
const int RESOURCE_QUANTITY=8;
|
2013-03-02 19:55:51 +03:00
|
|
|
const int HEROES_PER_TYPE=8; //amount of heroes of each type
|
|
|
|
|
|
|
|
// amounts of OH3 objects. Can be changed by mods, should be used only during H3 loading phase
|
|
|
|
const int F_NUMBER = 9;
|
|
|
|
const int ARTIFACTS_QUANTITY=171;
|
|
|
|
const int HEROES_QUANTITY=156;
|
|
|
|
const int SPELLS_QUANTITY=70;
|
|
|
|
const int CREATURES_COUNT = 197;
|
2012-12-14 18:32:53 +03:00
|
|
|
|
2015-10-16 02:03:40 +02:00
|
|
|
const ui32 BASE_MOVEMENT_COST = 100; //default cost for non-diagonal movement
|
2011-12-14 00:35:28 +03:00
|
|
|
}
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
class CArtifact;
|
2013-02-14 02:55:42 +03:00
|
|
|
class CArtifactInstance;
|
2013-02-11 02:24:57 +03:00
|
|
|
class CCreature;
|
|
|
|
class CSpell;
|
2013-02-14 02:55:42 +03:00
|
|
|
class CGameInfoCallback;
|
|
|
|
class CNonConstInfoCallback;
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
#define ID_LIKE_CLASS_COMMON(CLASS_NAME, ENUM_NAME) \
|
|
|
|
CLASS_NAME(const CLASS_NAME & other) \
|
|
|
|
{ \
|
|
|
|
num = other.num; \
|
|
|
|
} \
|
|
|
|
CLASS_NAME & operator=(const CLASS_NAME & other) \
|
|
|
|
{ \
|
|
|
|
num = other.num; \
|
|
|
|
return *this; \
|
|
|
|
} \
|
|
|
|
explicit CLASS_NAME(si32 id) \
|
|
|
|
: num(static_cast<ENUM_NAME>(id)) \
|
|
|
|
{} \
|
|
|
|
operator ENUM_NAME() const \
|
|
|
|
{ \
|
|
|
|
return num; \
|
|
|
|
} \
|
|
|
|
ENUM_NAME toEnum() const \
|
|
|
|
{ \
|
|
|
|
return num; \
|
|
|
|
} \
|
|
|
|
template <typename Handler> void serialize(Handler &h, const int version) \
|
|
|
|
{ \
|
|
|
|
h & num; \
|
|
|
|
} \
|
|
|
|
CLASS_NAME & advance(int i) \
|
|
|
|
{ \
|
|
|
|
num = (ENUM_NAME)((int)num + i); \
|
|
|
|
return *this; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
// Operators are performance-critical and to be inlined they must be in header
|
|
|
|
#define ID_LIKE_OPERATORS_INTERNAL(A, B, AN, BN) \
|
|
|
|
STRONG_INLINE bool operator==(const A & a, const B & b) \
|
|
|
|
{ \
|
|
|
|
return AN == BN ; \
|
|
|
|
} \
|
|
|
|
STRONG_INLINE bool operator!=(const A & a, const B & b) \
|
|
|
|
{ \
|
|
|
|
return AN != BN ; \
|
|
|
|
} \
|
|
|
|
STRONG_INLINE bool operator<(const A & a, const B & b) \
|
|
|
|
{ \
|
|
|
|
return AN < BN ; \
|
|
|
|
} \
|
|
|
|
STRONG_INLINE bool operator<=(const A & a, const B & b) \
|
|
|
|
{ \
|
|
|
|
return AN <= BN ; \
|
|
|
|
} \
|
|
|
|
STRONG_INLINE bool operator>(const A & a, const B & b) \
|
|
|
|
{ \
|
|
|
|
return AN > BN ; \
|
|
|
|
} \
|
|
|
|
STRONG_INLINE bool operator>=(const A & a, const B & b) \
|
|
|
|
{ \
|
|
|
|
return AN >= BN ; \
|
|
|
|
}
|
2013-02-11 02:24:57 +03:00
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
#define ID_LIKE_OPERATORS(CLASS_NAME, ENUM_NAME) \
|
|
|
|
ID_LIKE_OPERATORS_INTERNAL(CLASS_NAME, CLASS_NAME, a.num, b.num) \
|
|
|
|
ID_LIKE_OPERATORS_INTERNAL(CLASS_NAME, ENUM_NAME, a.num, b) \
|
|
|
|
ID_LIKE_OPERATORS_INTERNAL(ENUM_NAME, CLASS_NAME, a, b.num)
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
|
2013-02-14 02:55:42 +03:00
|
|
|
#define OP_DECL_INT(CLASS_NAME, OP) \
|
|
|
|
bool operator OP (const CLASS_NAME & b) const \
|
|
|
|
{ \
|
|
|
|
return num OP b.num; \
|
|
|
|
}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
#define INSTID_LIKE_CLASS_COMMON(CLASS_NAME, NUMERIC_NAME) \
|
|
|
|
public: \
|
|
|
|
CLASS_NAME() : BaseForID<CLASS_NAME, NUMERIC_NAME>(-1) {} \
|
|
|
|
CLASS_NAME(const CLASS_NAME & other): \
|
|
|
|
BaseForID<CLASS_NAME, NUMERIC_NAME>(other) \
|
|
|
|
{ \
|
|
|
|
} \
|
|
|
|
CLASS_NAME & operator=(const CLASS_NAME & other) \
|
|
|
|
{ \
|
|
|
|
num = other.num; \
|
|
|
|
return *this; \
|
|
|
|
} \
|
|
|
|
explicit CLASS_NAME(si32 id) \
|
|
|
|
: BaseForID<CLASS_NAME, NUMERIC_NAME>(id) \
|
2013-02-14 02:55:42 +03:00
|
|
|
{}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
template < typename Derived, typename NumericType>
|
2013-02-14 02:55:42 +03:00
|
|
|
class BaseForID
|
|
|
|
{
|
|
|
|
protected:
|
2013-03-03 20:06:03 +03:00
|
|
|
NumericType num;
|
2013-02-14 02:55:42 +03:00
|
|
|
public:
|
2013-03-03 20:06:03 +03:00
|
|
|
NumericType getNum() const
|
2013-02-14 02:55:42 +03:00
|
|
|
{
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
template <typename Handler> void serialize(Handler &h, const int version)
|
|
|
|
{
|
|
|
|
h & num;
|
|
|
|
}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
explicit BaseForID(NumericType _num = -1)
|
2013-02-14 02:55:42 +03:00
|
|
|
{
|
|
|
|
num = _num;
|
|
|
|
}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
void advance(int change)
|
|
|
|
{
|
|
|
|
num += change;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef BaseForID<Derived, NumericType> __SelfType;
|
|
|
|
OP_DECL_INT(__SelfType, ==)
|
|
|
|
OP_DECL_INT(__SelfType, !=)
|
|
|
|
OP_DECL_INT(__SelfType, <)
|
|
|
|
OP_DECL_INT(__SelfType, >)
|
|
|
|
OP_DECL_INT(__SelfType, <=)
|
|
|
|
OP_DECL_INT(__SelfType, >=)
|
2013-02-14 02:55:42 +03:00
|
|
|
};
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
template<typename Der, typename Num>
|
|
|
|
std::ostream & operator << (std::ostream & os, BaseForID<Der, Num> id);
|
2013-02-14 02:55:42 +03:00
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
template<typename Der, typename Num>
|
|
|
|
std::ostream & operator << (std::ostream & os, BaseForID<Der, Num> id)
|
2013-02-14 02:55:42 +03:00
|
|
|
{
|
2013-04-17 22:09:54 +03:00
|
|
|
//We use common type with short to force char and unsigned char to be promoted and formatted as numbers.
|
2013-04-18 10:55:57 +03:00
|
|
|
typedef typename std::common_type<short, Num>::type Number;
|
|
|
|
return os << static_cast<Number>(id.getNum());
|
2013-02-14 02:55:42 +03:00
|
|
|
}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
class ArtifactInstanceID : public BaseForID<ArtifactInstanceID, si32>
|
2013-02-14 02:55:42 +03:00
|
|
|
{
|
2013-03-03 20:06:03 +03:00
|
|
|
INSTID_LIKE_CLASS_COMMON(ArtifactInstanceID, si32)
|
2013-02-14 02:55:42 +03:00
|
|
|
|
|
|
|
friend class CGameInfoCallback;
|
|
|
|
friend class CNonConstInfoCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-05-27 13:53:28 +03:00
|
|
|
class QueryID : public BaseForID<QueryID, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(QueryID, si32)
|
|
|
|
|
|
|
|
QueryID & operator++()
|
|
|
|
{
|
|
|
|
++num;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
class ObjectInstanceID : public BaseForID<ObjectInstanceID, si32>
|
2013-02-14 02:55:42 +03:00
|
|
|
{
|
2013-03-03 20:06:03 +03:00
|
|
|
INSTID_LIKE_CLASS_COMMON(ObjectInstanceID, si32)
|
2013-02-14 02:55:42 +03:00
|
|
|
|
|
|
|
friend class CGameInfoCallback;
|
|
|
|
friend class CNonConstInfoCallback;
|
|
|
|
};
|
|
|
|
|
2013-05-19 01:30:48 +03:00
|
|
|
|
|
|
|
class HeroTypeID : public BaseForID<HeroTypeID, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(HeroTypeID, si32)
|
|
|
|
};
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
class SlotID : public BaseForID<SlotID, si32>
|
2013-02-16 17:03:47 +03:00
|
|
|
{
|
2013-03-03 20:06:03 +03:00
|
|
|
INSTID_LIKE_CLASS_COMMON(SlotID, si32)
|
2013-02-16 17:03:47 +03:00
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
friend class CGameInfoCallback;
|
2013-02-16 17:03:47 +03:00
|
|
|
friend class CNonConstInfoCallback;
|
|
|
|
|
|
|
|
DLL_LINKAGE static const SlotID COMMANDER_SLOT_PLACEHOLDER;
|
2015-11-07 10:42:06 +02:00
|
|
|
DLL_LINKAGE static const SlotID SUMMONED_SLOT_PLACEHOLDER; ///<for all summoned creatures, only during battle
|
2016-01-29 23:53:53 +02:00
|
|
|
DLL_LINKAGE static const SlotID WAR_MACHINES_SLOT; ///<for all war machines during battle
|
|
|
|
DLL_LINKAGE static const SlotID ARROW_TOWERS_SLOT; ///<for all arrow towers during battle
|
2013-02-16 17:03:47 +03:00
|
|
|
|
|
|
|
bool validSlot() const
|
|
|
|
{
|
|
|
|
return getNum() >= 0 && getNum() < GameConstants::ARMY_SIZE;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
class PlayerColor : public BaseForID<PlayerColor, ui8>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(PlayerColor, ui8)
|
|
|
|
|
2013-04-21 15:49:26 +03:00
|
|
|
enum EPlayerColor
|
|
|
|
{
|
|
|
|
PLAYER_LIMIT_I = 8
|
|
|
|
};
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
DLL_LINKAGE static const PlayerColor CANNOT_DETERMINE; //253
|
|
|
|
DLL_LINKAGE static const PlayerColor UNFLAGGABLE; //254 - neutral objects (pandora, banks)
|
|
|
|
DLL_LINKAGE static const PlayerColor NEUTRAL; //255
|
|
|
|
DLL_LINKAGE static const PlayerColor PLAYER_LIMIT; //player limit per map
|
|
|
|
|
2013-04-20 14:34:01 +03:00
|
|
|
DLL_LINKAGE bool isValidPlayer() const; //valid means < PLAYER_LIMIT (especially non-neutral)
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
friend class CGameInfoCallback;
|
|
|
|
friend class CNonConstInfoCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TeamID : public BaseForID<TeamID, ui8>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(TeamID, ui8)
|
|
|
|
|
|
|
|
DLL_LINKAGE static const TeamID NO_TEAM;
|
|
|
|
|
|
|
|
friend class CGameInfoCallback;
|
|
|
|
friend class CNonConstInfoCallback;
|
|
|
|
};
|
|
|
|
|
2015-03-08 14:18:53 +02:00
|
|
|
class TeleportChannelID : public BaseForID<TeleportChannelID, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(TeleportChannelID, si32)
|
|
|
|
|
|
|
|
friend class CGameInfoCallback;
|
|
|
|
friend class CNonConstInfoCallback;
|
|
|
|
};
|
|
|
|
|
2013-02-14 05:17:46 +03:00
|
|
|
// #ifndef INSTANTIATE_BASE_FOR_ID_HERE
|
|
|
|
// extern template std::ostream & operator << <ArtifactInstanceID>(std::ostream & os, BaseForID<ArtifactInstanceID> id);
|
|
|
|
// extern template std::ostream & operator << <ObjectInstanceID>(std::ostream & os, BaseForID<ObjectInstanceID> id);
|
|
|
|
// #endif
|
2013-02-11 02:24:57 +03:00
|
|
|
|
2011-12-14 00:35:28 +03:00
|
|
|
// Enum declarations
|
2012-04-14 05:20:22 +03:00
|
|
|
namespace PrimarySkill
|
|
|
|
{
|
2013-02-04 15:32:53 +03:00
|
|
|
enum PrimarySkill { ATTACK, DEFENSE, SPELL_POWER, KNOWLEDGE,
|
|
|
|
EXPERIENCE = 4}; //for some reason changePrimSkill uses it
|
2012-04-14 05:20:22 +03:00
|
|
|
}
|
|
|
|
|
2013-02-12 22:49:40 +03:00
|
|
|
class SecondarySkill
|
2013-02-04 22:43:16 +03:00
|
|
|
{
|
2013-02-12 22:49:40 +03:00
|
|
|
public:
|
|
|
|
enum ESecondarySkill
|
2013-02-04 22:43:16 +03:00
|
|
|
{
|
2013-02-12 22:49:40 +03:00
|
|
|
WRONG = -2,
|
2013-02-04 22:43:16 +03:00
|
|
|
DEFAULT = -1,
|
|
|
|
PATHFINDING = 0, ARCHERY, LOGISTICS, SCOUTING, DIPLOMACY, NAVIGATION, LEADERSHIP, WISDOM, MYSTICISM,
|
|
|
|
LUCK, BALLISTICS, EAGLE_EYE, NECROMANCY, ESTATES, FIRE_MAGIC, AIR_MAGIC, WATER_MAGIC, EARTH_MAGIC,
|
|
|
|
SCHOLAR, TACTICS, ARTILLERY, LEARNING, OFFENCE, ARMORER, INTELLIGENCE, SORCERY, RESISTANCE,
|
2013-04-23 12:16:20 +03:00
|
|
|
FIRST_AID, SKILL_SIZE
|
2013-02-04 22:43:16 +03:00
|
|
|
};
|
2013-02-12 22:49:40 +03:00
|
|
|
|
2013-04-23 12:16:20 +03:00
|
|
|
static_assert(GameConstants::SKILL_QUANTITY == SKILL_SIZE, "Incorrect number of skills");
|
|
|
|
|
2013-02-12 22:49:40 +03:00
|
|
|
SecondarySkill(ESecondarySkill _num = WRONG) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(SecondarySkill, ESecondarySkill)
|
|
|
|
|
|
|
|
ESecondarySkill num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(SecondarySkill, SecondarySkill::ESecondarySkill)
|
2013-02-04 22:43:16 +03:00
|
|
|
|
2011-12-14 00:35:28 +03:00
|
|
|
namespace EAlignment
|
|
|
|
{
|
|
|
|
enum EAlignment { GOOD, EVIL, NEUTRAL };
|
|
|
|
}
|
|
|
|
|
2012-09-05 15:49:23 +03:00
|
|
|
namespace ETownType
|
|
|
|
{
|
|
|
|
enum ETownType
|
|
|
|
{
|
|
|
|
ANY = -1,
|
2014-10-30 14:03:53 +02:00
|
|
|
CASTLE, RAMPART, TOWER, INFERNO, NECROPOLIS, DUNGEON, STRONGHOLD, FORTRESS, CONFLUX, NEUTRAL
|
2012-09-05 15:49:23 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
class BuildingID
|
2011-12-14 00:35:28 +03:00
|
|
|
{
|
2013-02-11 02:24:57 +03:00
|
|
|
public:
|
2011-12-14 00:35:28 +03:00
|
|
|
//Quite useful as long as most of building mechanics hardcoded
|
2012-09-05 15:49:23 +03:00
|
|
|
// NOTE: all building with completely configurable mechanics will be removed from list
|
2013-02-11 02:24:57 +03:00
|
|
|
enum EBuildingID
|
2011-12-14 00:35:28 +03:00
|
|
|
{
|
2013-02-11 22:11:34 +03:00
|
|
|
DEFAULT = -50,
|
2013-02-11 02:24:57 +03:00
|
|
|
NONE = -1,
|
|
|
|
MAGES_GUILD_1 = 0, MAGES_GUILD_2, MAGES_GUILD_3, MAGES_GUILD_4, MAGES_GUILD_5,
|
2011-12-14 00:35:28 +03:00
|
|
|
TAVERN, SHIPYARD, FORT, CITADEL, CASTLE,
|
|
|
|
VILLAGE_HALL, TOWN_HALL, CITY_HALL, CAPITOL, MARKETPLACE,
|
|
|
|
RESOURCE_SILO, BLACKSMITH, SPECIAL_1, HORDE_1, HORDE_1_UPGR,
|
|
|
|
SHIP, SPECIAL_2, SPECIAL_3, SPECIAL_4, HORDE_2,
|
2012-09-05 15:49:23 +03:00
|
|
|
HORDE_2_UPGR, GRAIL, EXTRA_TOWN_HALL, EXTRA_CITY_HALL, EXTRA_CAPITOL,
|
2013-02-11 22:11:34 +03:00
|
|
|
DWELL_FIRST=30, DWELL_LVL_2, DWELL_LVL_3, DWELL_LVL_4, DWELL_LVL_5, DWELL_LVL_6, DWELL_LAST=36,
|
|
|
|
DWELL_UP_FIRST=37, DWELL_LVL_2_UP, DWELL_LVL_3_UP, DWELL_LVL_4_UP, DWELL_LVL_5_UP,
|
|
|
|
DWELL_LVL_6_UP, DWELL_UP_LAST=43,
|
|
|
|
|
|
|
|
DWELL_LVL_1 = DWELL_FIRST,
|
|
|
|
DWELL_LVL_7 = DWELL_LAST,
|
|
|
|
DWELL_LVL_1_UP = DWELL_UP_FIRST,
|
|
|
|
DWELL_LVL_7_UP = DWELL_UP_LAST,
|
2012-09-05 15:49:23 +03:00
|
|
|
|
|
|
|
//Special buildings for towns.
|
|
|
|
LIGHTHOUSE = SPECIAL_1,
|
|
|
|
STABLES = SPECIAL_2, //Castle
|
|
|
|
BROTHERHOOD = SPECIAL_3,
|
|
|
|
|
|
|
|
MYSTIC_POND = SPECIAL_1,
|
2014-11-17 02:26:18 +02:00
|
|
|
FOUNTAIN_OF_FORTUNE = SPECIAL_2, //Rampart
|
|
|
|
TREASURY = SPECIAL_3,
|
2012-09-05 15:49:23 +03:00
|
|
|
|
|
|
|
ARTIFACT_MERCHANT = SPECIAL_1,
|
|
|
|
LOOKOUT_TOWER = SPECIAL_2, //Tower
|
|
|
|
LIBRARY = SPECIAL_3,
|
|
|
|
WALL_OF_KNOWLEDGE = SPECIAL_4,
|
|
|
|
|
|
|
|
STORMCLOUDS = SPECIAL_2,
|
|
|
|
CASTLE_GATE = SPECIAL_3, //Inferno
|
|
|
|
ORDER_OF_FIRE = SPECIAL_4,
|
|
|
|
|
|
|
|
COVER_OF_DARKNESS = SPECIAL_1,
|
|
|
|
NECROMANCY_AMPLIFIER = SPECIAL_2, //Necropolis
|
|
|
|
SKELETON_TRANSFORMER = SPECIAL_3,
|
|
|
|
|
|
|
|
//ARTIFACT_MERCHANT - same ID as in tower
|
|
|
|
MANA_VORTEX = SPECIAL_2,
|
|
|
|
PORTAL_OF_SUMMON = SPECIAL_3, //Dungeon
|
|
|
|
BATTLE_ACADEMY = SPECIAL_4,
|
|
|
|
|
|
|
|
ESCAPE_TUNNEL = SPECIAL_1,
|
|
|
|
FREELANCERS_GUILD = SPECIAL_2, //Stronghold
|
|
|
|
BALLISTA_YARD = SPECIAL_3,
|
|
|
|
HALL_OF_VALHALLA = SPECIAL_4,
|
|
|
|
|
|
|
|
CAGE_OF_WARLORDS = SPECIAL_1,
|
|
|
|
GLYPHS_OF_FEAR = SPECIAL_2, // Fortress
|
|
|
|
BLOOD_OBELISK = SPECIAL_3,
|
|
|
|
|
|
|
|
//ARTIFACT_MERCHANT - same ID as in tower
|
|
|
|
MAGIC_UNIVERSITY = SPECIAL_2, // Conflux
|
2011-12-14 00:35:28 +03:00
|
|
|
};
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
BuildingID(EBuildingID _num = NONE) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(BuildingID, EBuildingID)
|
|
|
|
|
|
|
|
EBuildingID num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(BuildingID, BuildingID::EBuildingID)
|
2011-12-14 00:35:28 +03:00
|
|
|
|
2015-12-02 21:05:10 +02:00
|
|
|
namespace EAiTactic
|
|
|
|
{
|
|
|
|
enum EAiTactic
|
|
|
|
{
|
|
|
|
NONE = -1,
|
|
|
|
RANDOM,
|
|
|
|
WARRIOR,
|
|
|
|
BUILDER,
|
|
|
|
EXPLORER
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2011-12-14 00:35:28 +03:00
|
|
|
namespace EBuildingState
|
|
|
|
{
|
|
|
|
enum EBuildingState
|
|
|
|
{
|
|
|
|
HAVE_CAPITAL, NO_WATER, FORBIDDEN, ADD_MAGES_GUILD, ALREADY_PRESENT, CANT_BUILD_TODAY,
|
2013-12-02 14:58:02 +03:00
|
|
|
NO_RESOURCES, ALLOWED, PREREQUIRES, MISSING_BASE, BUILDING_ERROR, TOWN_NOT_OWNED
|
2011-12-14 00:35:28 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ESpellCastProblem
|
|
|
|
{
|
|
|
|
enum ESpellCastProblem
|
|
|
|
{
|
|
|
|
OK, NO_HERO_TO_CAST_SPELL, ALREADY_CASTED_THIS_TURN, NO_SPELLBOOK, ANOTHER_ELEMENTAL_SUMMONED,
|
|
|
|
HERO_DOESNT_KNOW_SPELL, NOT_ENOUGH_MANA, ADVMAP_SPELL_INSTEAD_OF_BATTLE_SPELL,
|
|
|
|
SECOND_HEROS_SPELL_IMMUNITY, SPELL_LEVEL_LIMIT_EXCEEDED, NO_SPELLS_TO_DISPEL,
|
2012-08-26 12:07:48 +03:00
|
|
|
NO_APPROPRIATE_TARGET, STACK_IMMUNE_TO_SPELL, WRONG_SPELL_TARGET, ONGOING_TACTIC_PHASE,
|
|
|
|
MAGIC_IS_BLOCKED, //For Orb of Inhibition and similar - no casting at all
|
2014-11-12 04:50:51 +02:00
|
|
|
NOT_DECIDED,
|
2012-08-26 12:07:48 +03:00
|
|
|
INVALID
|
2011-12-14 00:35:28 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ECastingMode
|
|
|
|
{
|
2016-01-29 23:53:53 +02:00
|
|
|
enum ECastingMode
|
2014-11-13 03:53:25 +02:00
|
|
|
{
|
|
|
|
HERO_CASTING, AFTER_ATTACK_CASTING, //also includes cast before attack
|
|
|
|
MAGIC_MIRROR, CREATURE_ACTIVE_CASTING, ENCHANTER_CASTING,
|
2016-01-29 23:53:53 +02:00
|
|
|
SPELL_LIKE_ATTACK,
|
2015-09-17 02:43:31 +02:00
|
|
|
PASSIVE_CASTING//f.e. opening battle spells
|
2014-11-13 03:53:25 +02:00
|
|
|
};
|
2011-12-14 00:35:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace EMarketMode
|
|
|
|
{
|
|
|
|
enum EMarketMode
|
|
|
|
{
|
2013-02-13 22:35:43 +03:00
|
|
|
RESOURCE_RESOURCE, RESOURCE_PLAYER, CREATURE_RESOURCE, RESOURCE_ARTIFACT,
|
2011-12-14 00:35:28 +03:00
|
|
|
ARTIFACT_RESOURCE, ARTIFACT_EXP, CREATURE_EXP, CREATURE_UNDEAD, RESOURCE_SKILL,
|
|
|
|
MARTKET_AFTER_LAST_PLACEHOLDER
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace EBattleStackState
|
|
|
|
{
|
2015-11-05 00:37:53 +02:00
|
|
|
enum EBattleStackState
|
|
|
|
{
|
|
|
|
ALIVE = 180,
|
|
|
|
SUMMONED, CLONED,
|
2016-02-27 23:13:34 +02:00
|
|
|
GHOST, //stack was removed from battlefield
|
2015-11-05 00:37:53 +02:00
|
|
|
HAD_MORALE,
|
|
|
|
WAITING,
|
|
|
|
MOVED,
|
|
|
|
DEFENDING,
|
|
|
|
FEAR,
|
|
|
|
//remember to drain mana only once per turn
|
|
|
|
DRAINED_MANA,
|
|
|
|
//only for defending animation
|
2016-03-01 04:24:35 +02:00
|
|
|
DEFENDING_ANIM,
|
|
|
|
GHOST_PENDING// stack will become GHOST in next battle state update
|
2015-11-05 00:37:53 +02:00
|
|
|
};
|
2011-12-14 00:35:28 +03:00
|
|
|
}
|
|
|
|
|
2012-04-04 20:41:55 +03:00
|
|
|
namespace ECommander
|
|
|
|
{
|
2012-04-22 16:28:46 +03:00
|
|
|
enum SecondarySkills {ATTACK, DEFENSE, HEALTH, DAMAGE, SPEED, SPELL_POWER, CASTS, RESISTANCE};
|
2012-05-18 17:02:27 +03:00
|
|
|
const int MAX_SKILL_LEVEL = 5;
|
2012-04-04 20:41:55 +03:00
|
|
|
}
|
|
|
|
|
2013-12-08 20:54:13 +03:00
|
|
|
namespace EWallPart
|
2012-08-26 12:07:48 +03:00
|
|
|
{
|
2013-12-08 20:54:13 +03:00
|
|
|
enum EWallPart
|
2012-08-26 12:07:48 +03:00
|
|
|
{
|
2013-12-08 20:54:13 +03:00
|
|
|
INDESTRUCTIBLE_PART_OF_GATE = -3, INDESTRUCTIBLE_PART = -2, INVALID = -1,
|
2013-08-06 14:20:28 +03:00
|
|
|
KEEP = 0, BOTTOM_TOWER, BOTTOM_WALL, BELOW_GATE, OVER_GATE, UPPER_WALL, UPPER_TOWER, GATE,
|
2013-12-08 20:54:13 +03:00
|
|
|
PARTS_COUNT /* This constant SHOULD always stay as the last item in the enum. */
|
2012-08-26 12:07:48 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace EWallState
|
|
|
|
{
|
2012-12-24 18:07:30 +03:00
|
|
|
enum EWallState
|
2012-08-26 12:07:48 +03:00
|
|
|
{
|
2013-08-06 14:20:28 +03:00
|
|
|
NONE = -1, //no wall
|
|
|
|
DESTROYED,
|
2012-08-26 12:07:48 +03:00
|
|
|
DAMAGED,
|
2013-08-06 14:20:28 +03:00
|
|
|
INTACT
|
|
|
|
|
|
|
|
|
2012-08-26 12:07:48 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-02-13 16:40:31 +02:00
|
|
|
enum class EGateState : ui8
|
2016-01-29 21:35:11 +02:00
|
|
|
{
|
|
|
|
NONE,
|
2016-02-13 16:40:31 +02:00
|
|
|
CLOSED,
|
|
|
|
BLOCKED, //dead or alive stack blocking from outside
|
|
|
|
OPENED,
|
|
|
|
DESTROYED
|
2016-01-29 21:35:11 +02:00
|
|
|
};
|
|
|
|
|
2016-02-09 16:38:59 +02:00
|
|
|
namespace ESiegeHex
|
|
|
|
{
|
|
|
|
enum ESiegeHex : si16
|
|
|
|
{
|
|
|
|
DESTRUCTIBLE_WALL_1 = 29,
|
|
|
|
DESTRUCTIBLE_WALL_2 = 78,
|
|
|
|
DESTRUCTIBLE_WALL_3 = 130,
|
|
|
|
DESTRUCTIBLE_WALL_4 = 182,
|
|
|
|
GATE_BRIDGE = 94,
|
|
|
|
GATE_OUTER = 95,
|
|
|
|
GATE_INNER = 96
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2014-05-30 17:50:06 +03:00
|
|
|
namespace ETileType
|
|
|
|
{
|
|
|
|
enum ETileType
|
|
|
|
{
|
|
|
|
FREE,
|
|
|
|
POSSIBLE,
|
|
|
|
BLOCKED,
|
|
|
|
USED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-03-09 00:45:39 +02:00
|
|
|
enum class ETeleportChannelType
|
2015-03-08 14:18:53 +02:00
|
|
|
{
|
2015-03-09 00:45:39 +02:00
|
|
|
IMPASSABLE,
|
|
|
|
BIDIRECTIONAL,
|
|
|
|
UNIDIRECTIONAL,
|
|
|
|
MIXED
|
|
|
|
};
|
2015-03-08 14:18:53 +02:00
|
|
|
|
2015-01-03 05:59:51 +02:00
|
|
|
|
|
|
|
namespace ERiverType
|
|
|
|
{
|
|
|
|
enum ERiverType
|
|
|
|
{
|
|
|
|
NO_RIVER, CLEAR_RIVER, ICY_RIVER, MUDDY_RIVER, LAVA_RIVER
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ERoadType
|
|
|
|
{
|
|
|
|
enum ERoadType
|
|
|
|
{
|
|
|
|
NO_ROAD, DIRT_ROAD, GRAVEL_ROAD, COBBLESTONE_ROAD
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
class Obj
|
2012-03-05 22:11:28 +03:00
|
|
|
{
|
2013-02-11 02:24:57 +03:00
|
|
|
public:
|
|
|
|
enum EObj
|
2012-03-05 22:11:28 +03:00
|
|
|
{
|
2013-02-07 20:34:50 +03:00
|
|
|
NO_OBJ = -1,
|
2012-09-23 21:01:04 +03:00
|
|
|
ALTAR_OF_SACRIFICE = 2,
|
|
|
|
ANCHOR_POINT = 3,
|
|
|
|
ARENA = 4,
|
2012-07-18 13:10:14 +03:00
|
|
|
ARTIFACT = 5,
|
2012-09-23 21:01:04 +03:00
|
|
|
PANDORAS_BOX = 6,
|
|
|
|
BLACK_MARKET = 7,
|
2012-03-05 22:11:28 +03:00
|
|
|
BOAT = 8,
|
2012-07-18 13:10:14 +03:00
|
|
|
BORDERGUARD = 9,
|
2012-07-08 19:36:20 +03:00
|
|
|
KEYMASTER = 10,
|
2012-09-23 21:01:04 +03:00
|
|
|
BUOY = 11,
|
|
|
|
CAMPFIRE = 12,
|
|
|
|
CARTOGRAPHER = 13,
|
|
|
|
SWAN_POND = 14,
|
|
|
|
COVER_OF_DARKNESS = 15,
|
2012-03-05 22:11:28 +03:00
|
|
|
CREATURE_BANK = 16,
|
|
|
|
CREATURE_GENERATOR1 = 17,
|
2012-09-23 21:01:04 +03:00
|
|
|
CREATURE_GENERATOR2 = 18,
|
|
|
|
CREATURE_GENERATOR3 = 19,
|
|
|
|
CREATURE_GENERATOR4 = 20,
|
2012-04-23 22:56:37 +03:00
|
|
|
CURSED_GROUND1 = 21,
|
2012-09-23 21:01:04 +03:00
|
|
|
CORPSE = 22,
|
|
|
|
MARLETTO_TOWER = 23,
|
2012-03-05 22:11:28 +03:00
|
|
|
DERELICT_SHIP = 24,
|
|
|
|
DRAGON_UTOPIA = 25,
|
2012-09-23 21:01:04 +03:00
|
|
|
EVENT = 26,
|
|
|
|
EYE_OF_MAGI = 27,
|
|
|
|
FAERIE_RING = 28,
|
|
|
|
FLOTSAM = 29,
|
|
|
|
FOUNTAIN_OF_FORTUNE = 30,
|
|
|
|
FOUNTAIN_OF_YOUTH = 31,
|
|
|
|
GARDEN_OF_REVELATION = 32,
|
2012-03-05 22:11:28 +03:00
|
|
|
GARRISON = 33,
|
2012-09-23 21:01:04 +03:00
|
|
|
HERO = 34,
|
2012-08-29 12:19:20 +03:00
|
|
|
HILL_FORT = 35,
|
2012-12-24 18:07:30 +03:00
|
|
|
GRAIL = 36,
|
2012-09-23 21:01:04 +03:00
|
|
|
HUT_OF_MAGI = 37,
|
|
|
|
IDOL_OF_FORTUNE = 38,
|
|
|
|
LEAN_TO = 39,
|
2012-03-29 21:26:06 +03:00
|
|
|
LIBRARY_OF_ENLIGHTENMENT = 41,
|
2012-12-24 18:07:30 +03:00
|
|
|
LIGHTHOUSE = 42,
|
2014-06-01 13:02:43 +03:00
|
|
|
MONOLITH_ONE_WAY_ENTRANCE = 43,
|
|
|
|
MONOLITH_ONE_WAY_EXIT = 44,
|
|
|
|
MONOLITH_TWO_WAY = 45,
|
2012-04-23 22:56:37 +03:00
|
|
|
MAGIC_PLAINS1 = 46,
|
2012-03-29 21:26:06 +03:00
|
|
|
SCHOOL_OF_MAGIC = 47,
|
2012-12-24 18:07:30 +03:00
|
|
|
MAGIC_SPRING = 48,
|
2012-08-29 12:19:20 +03:00
|
|
|
MAGIC_WELL = 49,
|
2012-09-23 21:01:04 +03:00
|
|
|
MERCENARY_CAMP = 51,
|
|
|
|
MERMAID = 52,
|
2012-03-05 22:11:28 +03:00
|
|
|
MINE = 53,
|
|
|
|
MONSTER = 54,
|
2012-09-23 21:01:04 +03:00
|
|
|
MYSTICAL_GARDEN = 55,
|
|
|
|
OASIS = 56,
|
2012-03-05 22:11:28 +03:00
|
|
|
OBELISK = 57,
|
2012-09-23 21:01:04 +03:00
|
|
|
REDWOOD_OBSERVATORY = 58,
|
|
|
|
OCEAN_BOTTLE = 59,
|
|
|
|
PILLAR_OF_FIRE = 60,
|
|
|
|
STAR_AXIS = 61,
|
2012-07-21 10:15:53 +03:00
|
|
|
PRISON = 62,
|
2012-12-24 18:07:30 +03:00
|
|
|
PYRAMID = 63,//subtype 0
|
|
|
|
WOG_OBJECT = 63,//subtype > 0
|
2012-09-23 21:01:04 +03:00
|
|
|
RALLY_FLAG = 64,
|
2012-12-24 13:18:30 +03:00
|
|
|
RANDOM_ART = 65,
|
|
|
|
RANDOM_TREASURE_ART = 66,
|
|
|
|
RANDOM_MINOR_ART = 67,
|
|
|
|
RANDOM_MAJOR_ART = 68,
|
|
|
|
RANDOM_RELIC_ART = 69,
|
|
|
|
RANDOM_HERO = 70,
|
2013-02-13 22:35:43 +03:00
|
|
|
RANDOM_MONSTER = 71,
|
2012-12-24 13:18:30 +03:00
|
|
|
RANDOM_MONSTER_L1 = 72,
|
|
|
|
RANDOM_MONSTER_L2 = 73,
|
|
|
|
RANDOM_MONSTER_L3 = 74,
|
|
|
|
RANDOM_MONSTER_L4 = 75,
|
|
|
|
RANDOM_RESOURCE = 76,
|
2012-09-23 21:01:04 +03:00
|
|
|
RANDOM_TOWN = 77,
|
|
|
|
REFUGEE_CAMP = 78,
|
|
|
|
RESOURCE = 79,
|
|
|
|
SANCTUARY = 80,
|
|
|
|
SCHOLAR = 81,
|
|
|
|
SEA_CHEST = 82,
|
2012-07-18 13:10:14 +03:00
|
|
|
SEER_HUT = 83,
|
2012-03-05 22:11:28 +03:00
|
|
|
CRYPT = 84,
|
|
|
|
SHIPWRECK = 85,
|
2012-09-23 21:01:04 +03:00
|
|
|
SHIPWRECK_SURVIVOR = 86,
|
|
|
|
SHIPYARD = 87,
|
2012-12-24 18:07:30 +03:00
|
|
|
SHRINE_OF_MAGIC_INCANTATION = 88,
|
|
|
|
SHRINE_OF_MAGIC_GESTURE = 89,
|
2012-09-23 21:01:04 +03:00
|
|
|
SHRINE_OF_MAGIC_THOUGHT = 90,
|
2012-12-24 18:07:30 +03:00
|
|
|
SIGN = 91,
|
|
|
|
SIRENS = 92,
|
2012-09-23 21:01:04 +03:00
|
|
|
SPELL_SCROLL = 93,
|
2012-03-06 21:49:23 +03:00
|
|
|
STABLES = 94,
|
2012-09-23 21:01:04 +03:00
|
|
|
TAVERN = 95,
|
|
|
|
TEMPLE = 96,
|
|
|
|
DEN_OF_THIEVES = 97,
|
|
|
|
TOWN = 98,
|
2012-03-05 22:11:28 +03:00
|
|
|
TRADING_POST = 99,
|
2012-09-23 21:01:04 +03:00
|
|
|
LEARNING_STONE = 100,
|
|
|
|
TREASURE_CHEST = 101,
|
2012-04-28 16:01:39 +03:00
|
|
|
TREE_OF_KNOWLEDGE = 102,
|
2012-03-05 22:11:28 +03:00
|
|
|
SUBTERRANEAN_GATE = 103,
|
2012-04-08 04:15:18 +03:00
|
|
|
UNIVERSITY = 104,
|
2012-09-23 21:01:04 +03:00
|
|
|
WAGON = 105,
|
|
|
|
WAR_MACHINE_FACTORY = 106,
|
2012-03-29 21:26:06 +03:00
|
|
|
SCHOOL_OF_WAR = 107,
|
2012-09-23 21:01:04 +03:00
|
|
|
WARRIORS_TOMB = 108,
|
|
|
|
WATER_WHEEL = 109,
|
|
|
|
WATERING_HOLE = 110,
|
2012-03-05 22:11:28 +03:00
|
|
|
WHIRLPOOL = 111,
|
2012-09-23 21:01:04 +03:00
|
|
|
WINDMILL = 112,
|
2013-02-13 22:35:43 +03:00
|
|
|
WITCH_HUT = 113,
|
2012-09-23 21:01:04 +03:00
|
|
|
HOLE = 124,
|
2012-12-24 13:18:30 +03:00
|
|
|
RANDOM_MONSTER_L5 = 162,
|
|
|
|
RANDOM_MONSTER_L6 = 163,
|
|
|
|
RANDOM_MONSTER_L7 = 164,
|
2012-03-05 22:11:28 +03:00
|
|
|
BORDER_GATE = 212,
|
2012-09-23 21:01:04 +03:00
|
|
|
FREELANCERS_GUILD = 213,
|
|
|
|
HERO_PLACEHOLDER = 214,
|
2012-07-19 12:10:55 +03:00
|
|
|
QUEST_GUARD = 215,
|
2012-12-24 13:18:30 +03:00
|
|
|
RANDOM_DWELLING = 216,
|
|
|
|
RANDOM_DWELLING_LVL = 217, //subtype = creature level
|
|
|
|
RANDOM_DWELLING_FACTION = 218, //subtype = faction
|
2012-03-05 22:11:28 +03:00
|
|
|
GARRISON2 = 219,
|
2012-08-08 11:27:52 +03:00
|
|
|
ABANDONED_MINE = 220,
|
2012-09-23 21:01:04 +03:00
|
|
|
TRADING_POST_SNOW = 221,
|
2012-04-23 22:56:37 +03:00
|
|
|
CLOVER_FIELD = 222,
|
|
|
|
CURSED_GROUND2 = 223,
|
|
|
|
EVIL_FOG = 224,
|
|
|
|
FAVORABLE_WINDS = 225,
|
|
|
|
FIERY_FIELDS = 226,
|
|
|
|
HOLY_GROUNDS = 227,
|
|
|
|
LUCID_POOLS = 228,
|
|
|
|
MAGIC_CLOUDS = 229,
|
|
|
|
MAGIC_PLAINS2 = 230,
|
|
|
|
ROCKLANDS = 231,
|
|
|
|
};
|
2013-02-11 02:24:57 +03:00
|
|
|
Obj(EObj _num = NO_OBJ) : num(_num)
|
|
|
|
{}
|
2013-11-24 14:36:51 +03:00
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(Obj, EObj)
|
|
|
|
|
|
|
|
EObj num;
|
|
|
|
};
|
2013-02-11 02:24:57 +03:00
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(Obj, Obj::EObj)
|
2012-04-23 22:56:37 +03:00
|
|
|
|
2012-08-26 12:07:48 +03:00
|
|
|
namespace SecSkillLevel
|
|
|
|
{
|
|
|
|
enum SecSkillLevel
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
BASIC,
|
|
|
|
ADVANCED,
|
2013-04-23 12:16:20 +03:00
|
|
|
EXPERT,
|
|
|
|
LEVELS_SIZE
|
2012-08-26 12:07:48 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-04 00:05:44 +03:00
|
|
|
|
2012-04-23 22:56:37 +03:00
|
|
|
//follows ERM BI (battle image) format
|
|
|
|
namespace BattlefieldBI
|
|
|
|
{
|
2013-02-04 00:05:44 +03:00
|
|
|
enum BattlefieldBI
|
2012-04-23 22:56:37 +03:00
|
|
|
{
|
|
|
|
NONE = -1,
|
|
|
|
COASTAL,
|
2012-05-26 14:01:31 +03:00
|
|
|
CURSED_GROUND,
|
2013-02-04 00:05:44 +03:00
|
|
|
MAGIC_PLAINS,
|
2012-04-23 22:56:37 +03:00
|
|
|
HOLY_GROUND,
|
|
|
|
EVIL_FOG,
|
|
|
|
CLOVER_FIELD,
|
|
|
|
LUCID_POOLS,
|
|
|
|
FIERY_FIELDS,
|
|
|
|
ROCKLANDS,
|
2013-07-07 22:44:08 +03:00
|
|
|
MAGIC_CLOUDS
|
2012-03-05 22:11:28 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-02 11:29:57 +03:00
|
|
|
namespace Date
|
|
|
|
{
|
|
|
|
enum EDateType
|
|
|
|
{
|
|
|
|
DAY = 0,
|
|
|
|
DAY_OF_WEEK = 1,
|
|
|
|
WEEK = 2,
|
|
|
|
MONTH = 3,
|
|
|
|
DAY_OF_MONTH
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-04 00:05:44 +03:00
|
|
|
namespace Battle
|
|
|
|
{
|
|
|
|
enum ActionType
|
|
|
|
{
|
2015-10-08 07:15:29 +02:00
|
|
|
CANCEL = -3,
|
2013-07-07 22:44:08 +03:00
|
|
|
END_TACTIC_PHASE = -2,
|
|
|
|
INVALID = -1,
|
|
|
|
NO_ACTION = 0,
|
|
|
|
HERO_SPELL,
|
|
|
|
WALK, DEFEND,
|
|
|
|
RETREAT,
|
|
|
|
SURRENDER,
|
|
|
|
WALK_AND_ATTACK,
|
|
|
|
SHOOT,
|
|
|
|
WAIT,
|
|
|
|
CATAPULT,
|
|
|
|
MONSTER_SPELL,
|
|
|
|
BAD_MORALE,
|
|
|
|
STACK_HEAL,
|
|
|
|
DAEMON_SUMMONING
|
2013-02-04 00:05:44 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-11-09 19:25:20 +03:00
|
|
|
std::ostream & operator<<(std::ostream & os, const Battle::ActionType actionType);
|
|
|
|
|
2015-03-22 21:32:22 +02:00
|
|
|
class DLL_LINKAGE ETerrainType
|
2013-02-04 00:05:44 +03:00
|
|
|
{
|
2013-02-13 01:24:48 +03:00
|
|
|
public:
|
|
|
|
enum EETerrainType
|
2013-02-04 00:05:44 +03:00
|
|
|
{
|
|
|
|
WRONG = -2, BORDER = -1, DIRT, SAND, GRASS, SNOW, SWAMP,
|
|
|
|
ROUGH, SUBTERRANEAN, LAVA, WATER, ROCK
|
|
|
|
};
|
2013-02-13 01:24:48 +03:00
|
|
|
|
|
|
|
ETerrainType(EETerrainType _num = WRONG) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(ETerrainType, EETerrainType)
|
|
|
|
|
|
|
|
EETerrainType num;
|
2015-03-22 21:32:22 +02:00
|
|
|
|
|
|
|
std::string toString() const;
|
2013-02-13 01:24:48 +03:00
|
|
|
};
|
|
|
|
|
2015-11-05 11:46:44 +02:00
|
|
|
DLL_LINKAGE std::ostream & operator<<(std::ostream & os, const ETerrainType terrainType);
|
2015-03-22 21:32:22 +02:00
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(ETerrainType, ETerrainType::EETerrainType)
|
2013-02-04 00:05:44 +03:00
|
|
|
|
2015-11-29 11:32:06 +02:00
|
|
|
class DLL_LINKAGE EDiggingStatus
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum EEDiggingStatus
|
|
|
|
{
|
|
|
|
UNKNOWN = -1,
|
|
|
|
CAN_DIG = 0,
|
|
|
|
LACK_OF_MOVEMENT,
|
|
|
|
WRONG_TERRAIN,
|
|
|
|
TILE_OCCUPIED
|
|
|
|
};
|
|
|
|
|
|
|
|
EDiggingStatus(EEDiggingStatus _num = UNKNOWN) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(EDiggingStatus, EEDiggingStatus)
|
|
|
|
|
|
|
|
EEDiggingStatus num;
|
|
|
|
};
|
|
|
|
|
|
|
|
ID_LIKE_OPERATORS(EDiggingStatus, EDiggingStatus::EEDiggingStatus)
|
|
|
|
|
2015-11-02 10:05:26 +02:00
|
|
|
class DLL_LINKAGE EPathfindingLayer
|
|
|
|
{
|
|
|
|
public:
|
2015-11-19 02:08:57 +02:00
|
|
|
enum EEPathfindingLayer : ui8
|
2015-11-02 10:05:26 +02:00
|
|
|
{
|
2015-11-19 03:01:56 +02:00
|
|
|
LAND = 0, SAIL = 1, WATER, AIR, NUM_LAYERS, WRONG, AUTO
|
2015-11-02 10:05:26 +02:00
|
|
|
};
|
|
|
|
|
2015-11-02 12:25:01 +02:00
|
|
|
EPathfindingLayer(EEPathfindingLayer _num = WRONG) : num(_num)
|
2015-11-02 10:05:26 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(EPathfindingLayer, EEPathfindingLayer)
|
|
|
|
|
|
|
|
EEPathfindingLayer num;
|
|
|
|
};
|
|
|
|
|
2015-11-05 11:46:44 +02:00
|
|
|
DLL_LINKAGE std::ostream & operator<<(std::ostream & os, const EPathfindingLayer pathfindingLayer);
|
2015-11-02 10:05:26 +02:00
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(EPathfindingLayer, EPathfindingLayer::EEPathfindingLayer)
|
2013-02-04 00:05:44 +03:00
|
|
|
|
2013-02-13 01:24:48 +03:00
|
|
|
class BFieldType
|
2013-02-04 00:05:44 +03:00
|
|
|
{
|
2013-02-13 01:24:48 +03:00
|
|
|
public:
|
2013-02-13 22:35:43 +03:00
|
|
|
// 1. sand/shore 2. sand/mesas 3. dirt/birches 4. dirt/hills 5. dirt/pines 6. grass/hills 7. grass/pines
|
2013-02-04 00:05:44 +03:00
|
|
|
//8. lava 9. magic plains 10. snow/mountains 11. snow/trees 12. subterranean 13. swamp/trees 14. fiery fields
|
|
|
|
//15. rock lands 16. magic clouds 17. lucid pools 18. holy ground 19. clover field 20. evil fog
|
2015-12-06 01:23:41 +02:00
|
|
|
//21. "favorable winds" text on magic plains background 22. cursed ground 23. rough 24. ship to ship 25. ship
|
2013-02-13 01:24:48 +03:00
|
|
|
enum EBFieldType {NONE = -1, NONE2, SAND_SHORE, SAND_MESAS, DIRT_BIRCHES, DIRT_HILLS, DIRT_PINES, GRASS_HILLS,
|
2013-02-04 00:05:44 +03:00
|
|
|
GRASS_PINES, LAVA, MAGIC_PLAINS, SNOW_MOUNTAINS, SNOW_TREES, SUBTERRANEAN, SWAMP_TREES, FIERY_FIELDS,
|
2015-12-06 01:23:41 +02:00
|
|
|
ROCKLANDS, MAGIC_CLOUDS, LUCID_POOLS, HOLY_GROUND, CLOVER_FIELD, EVIL_FOG, FAVORABLE_WINDS, CURSED_GROUND,
|
2013-02-04 00:05:44 +03:00
|
|
|
ROUGH, SHIP_TO_SHIP, SHIP
|
|
|
|
};
|
2013-02-13 01:24:48 +03:00
|
|
|
|
|
|
|
BFieldType(EBFieldType _num = NONE) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(BFieldType, EBFieldType)
|
|
|
|
|
|
|
|
EBFieldType num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(BFieldType, BFieldType::EBFieldType)
|
2013-02-04 00:05:44 +03:00
|
|
|
|
2013-02-09 15:56:35 +03:00
|
|
|
namespace EPlayerStatus
|
|
|
|
{
|
|
|
|
enum EStatus {WRONG = -1, INGAME, LOSER, WINNER};
|
|
|
|
}
|
|
|
|
|
2013-02-04 00:05:44 +03:00
|
|
|
namespace PlayerRelations
|
|
|
|
{
|
|
|
|
enum PlayerRelations {ENEMIES, ALLIES, SAME_PLAYER};
|
|
|
|
}
|
|
|
|
|
2013-02-12 22:49:40 +03:00
|
|
|
class ArtifactPosition
|
2013-02-07 02:24:43 +03:00
|
|
|
{
|
2013-02-12 22:49:40 +03:00
|
|
|
public:
|
|
|
|
enum EArtifactPosition
|
2013-02-07 02:24:43 +03:00
|
|
|
{
|
|
|
|
FIRST_AVAILABLE = -2,
|
|
|
|
PRE_FIRST = -1, //sometimes used as error, sometimes as first free in backpack
|
2013-11-24 14:36:51 +03:00
|
|
|
HEAD, SHOULDERS, NECK, RIGHT_HAND, LEFT_HAND, TORSO, //5
|
|
|
|
RIGHT_RING, LEFT_RING, FEET, //8
|
|
|
|
MISC1, MISC2, MISC3, MISC4, //12
|
|
|
|
MACH1, MACH2, MACH3, MACH4, //16
|
|
|
|
SPELLBOOK, MISC5, //18
|
2013-02-07 02:24:43 +03:00
|
|
|
AFTER_LAST,
|
|
|
|
//cres
|
|
|
|
CREATURE_SLOT = 0,
|
|
|
|
COMMANDER1 = 0, COMMANDER2, COMMANDER3, COMMANDER4, COMMANDER5, COMMANDER6, COMMANDER_AFTER_LAST
|
|
|
|
};
|
2013-02-12 22:49:40 +03:00
|
|
|
|
2013-11-24 14:36:51 +03:00
|
|
|
static_assert (AFTER_LAST == 19, "incorrect number of artifact slots");
|
|
|
|
|
2013-02-12 22:49:40 +03:00
|
|
|
ArtifactPosition(EArtifactPosition _num = PRE_FIRST) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(ArtifactPosition, EArtifactPosition)
|
|
|
|
|
|
|
|
EArtifactPosition num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(ArtifactPosition, ArtifactPosition::EArtifactPosition)
|
2013-02-04 00:05:44 +03:00
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
class ArtifactID
|
2013-02-07 20:34:50 +03:00
|
|
|
{
|
2013-02-11 02:24:57 +03:00
|
|
|
public:
|
|
|
|
enum EArtifactID
|
2013-02-07 20:34:50 +03:00
|
|
|
{
|
|
|
|
NONE = -1,
|
|
|
|
SPELLBOOK = 0,
|
|
|
|
SPELL_SCROLL = 1,
|
|
|
|
GRAIL = 2,
|
|
|
|
CATAPULT = 3,
|
|
|
|
BALLISTA = 4,
|
|
|
|
AMMO_CART = 5,
|
|
|
|
FIRST_AID_TENT = 6,
|
2013-03-02 19:55:51 +03:00
|
|
|
//CENTAUR_AXE = 7,
|
|
|
|
//BLACKSHARD_OF_THE_DEAD_KNIGHT = 8,
|
2015-11-07 10:46:58 +02:00
|
|
|
ARMAGEDDONS_BLADE = 128,
|
2014-12-24 17:49:12 +02:00
|
|
|
TITANS_THUNDER = 135,
|
2013-03-02 19:55:51 +03:00
|
|
|
//CORNUCOPIA = 140,
|
2015-09-23 21:14:41 +02:00
|
|
|
//FIXME: the following is only true if WoG is enabled. Otherwise other mod artifacts will take these slots.
|
2013-02-11 17:42:09 +03:00
|
|
|
ART_SELECTION = 144,
|
2016-08-18 05:35:29 +02:00
|
|
|
ART_LOCK = 145, // FIXME: We must get rid of this one since it's conflict with artifact from mods. See issue 2455
|
2013-02-07 20:34:50 +03:00
|
|
|
AXE_OF_SMASHING = 146,
|
|
|
|
MITHRIL_MAIL = 147,
|
|
|
|
SWORD_OF_SHARPNESS = 148,
|
|
|
|
HELM_OF_IMMORTALITY = 149,
|
|
|
|
PENDANT_OF_SORCERY = 150,
|
|
|
|
BOOTS_OF_HASTE = 151,
|
|
|
|
BOW_OF_SEEKING = 152,
|
2013-03-04 21:33:58 +03:00
|
|
|
DRAGON_EYE_RING = 153
|
2013-03-02 19:55:51 +03:00
|
|
|
//HARDENED_SHIELD = 154,
|
|
|
|
//SLAVAS_RING_OF_POWER = 155
|
2013-02-07 20:34:50 +03:00
|
|
|
};
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
ArtifactID(EArtifactID _num = NONE) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
DLL_LINKAGE CArtifact * toArtifact() const;
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(ArtifactID, EArtifactID)
|
|
|
|
|
|
|
|
EArtifactID num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(ArtifactID, ArtifactID::EArtifactID)
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
class CreatureID
|
2013-02-07 20:34:50 +03:00
|
|
|
{
|
2013-02-11 02:24:57 +03:00
|
|
|
public:
|
|
|
|
enum ECreatureID
|
2013-02-07 20:34:50 +03:00
|
|
|
{
|
|
|
|
NONE = -1,
|
|
|
|
CAVALIER = 10,
|
|
|
|
CHAMPION = 11,
|
|
|
|
STONE_GOLEM = 32,
|
|
|
|
IRON_GOLEM = 33,
|
|
|
|
IMP = 42,
|
2013-02-12 22:49:40 +03:00
|
|
|
SKELETON = 56,
|
|
|
|
WALKING_DEAD = 58,
|
|
|
|
WIGHTS = 60,
|
|
|
|
LICHES = 64,
|
2015-09-04 17:08:25 +02:00
|
|
|
BONE_DRAGON = 68,
|
2013-02-07 20:34:50 +03:00
|
|
|
TROGLODYTES = 70,
|
2015-09-04 17:08:25 +02:00
|
|
|
HYDRA = 110,
|
|
|
|
CHAOS_HYDRA = 111,
|
2013-02-07 20:34:50 +03:00
|
|
|
AIR_ELEMENTAL = 112,
|
|
|
|
EARTH_ELEMENTAL = 113,
|
|
|
|
FIRE_ELEMENTAL = 114,
|
|
|
|
WATER_ELEMENTAL = 115,
|
|
|
|
GOLD_GOLEM = 116,
|
|
|
|
DIAMOND_GOLEM = 117,
|
2016-02-01 19:03:57 +02:00
|
|
|
PSYCHIC_ELEMENTAL = 120,
|
2013-02-07 20:34:50 +03:00
|
|
|
CATAPULT = 145,
|
|
|
|
BALLISTA = 146,
|
|
|
|
FIRST_AID_TENT = 147,
|
|
|
|
AMMO_CART = 148,
|
|
|
|
ARROW_TOWERS = 149
|
|
|
|
};
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
CreatureID(ECreatureID _num = NONE) : num(_num)
|
|
|
|
{}
|
|
|
|
|
|
|
|
DLL_LINKAGE CCreature * toCreature() const;
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(CreatureID, ECreatureID)
|
|
|
|
|
|
|
|
ECreatureID num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(CreatureID, CreatureID::ECreatureID)
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
class SpellID
|
2013-02-09 01:42:46 +03:00
|
|
|
{
|
2013-02-11 02:24:57 +03:00
|
|
|
public:
|
|
|
|
enum ESpellID
|
2013-02-09 01:42:46 +03:00
|
|
|
{
|
2013-02-11 02:24:57 +03:00
|
|
|
PRESET = -2,
|
|
|
|
NONE = -1,
|
2013-02-09 01:42:46 +03:00
|
|
|
SUMMON_BOAT=0, SCUTTLE_BOAT=1, VISIONS=2, VIEW_EARTH=3, DISGUISE=4, VIEW_AIR=5,
|
|
|
|
FLY=6, WATER_WALK=7, DIMENSION_DOOR=8, TOWN_PORTAL=9,
|
|
|
|
|
|
|
|
QUICKSAND=10, LAND_MINE=11, FORCE_FIELD=12, FIRE_WALL=13, EARTHQUAKE=14,
|
|
|
|
MAGIC_ARROW=15, ICE_BOLT=16, LIGHTNING_BOLT=17, IMPLOSION=18,
|
|
|
|
CHAIN_LIGHTNING=19, FROST_RING=20, FIREBALL=21, INFERNO=22,
|
|
|
|
METEOR_SHOWER=23, DEATH_RIPPLE=24, DESTROY_UNDEAD=25, ARMAGEDDON=26,
|
|
|
|
SHIELD=27, AIR_SHIELD=28, FIRE_SHIELD=29, PROTECTION_FROM_AIR=30,
|
|
|
|
PROTECTION_FROM_FIRE=31, PROTECTION_FROM_WATER=32,
|
|
|
|
PROTECTION_FROM_EARTH=33, ANTI_MAGIC=34, DISPEL=35, MAGIC_MIRROR=36,
|
|
|
|
CURE=37, RESURRECTION=38, ANIMATE_DEAD=39, SACRIFICE=40, BLESS=41,
|
|
|
|
CURSE=42, BLOODLUST=43, PRECISION=44, WEAKNESS=45, STONE_SKIN=46,
|
|
|
|
DISRUPTING_RAY=47, PRAYER=48, MIRTH=49, SORROW=50, FORTUNE=51,
|
|
|
|
MISFORTUNE=52, HASTE=53, SLOW=54, SLAYER=55, FRENZY=56,
|
|
|
|
TITANS_LIGHTNING_BOLT=57, COUNTERSTRIKE=58, BERSERK=59, HYPNOTIZE=60,
|
|
|
|
FORGETFULNESS=61, BLIND=62, TELEPORT=63, REMOVE_OBSTACLE=64, CLONE=65,
|
|
|
|
SUMMON_FIRE_ELEMENTAL=66, SUMMON_EARTH_ELEMENTAL=67, SUMMON_WATER_ELEMENTAL=68, SUMMON_AIR_ELEMENTAL=69,
|
|
|
|
|
|
|
|
STONE_GAZE=70, POISON=71, BIND=72, DISEASE=73, PARALYZE=74, AGE=75, DEATH_CLOUD=76, THUNDERBOLT=77,
|
2014-03-09 12:37:20 +03:00
|
|
|
DISPEL_HELPFUL_SPELLS=78, DEATH_STARE=79, ACID_BREATH_DEFENSE=80, ACID_BREATH_DAMAGE=81,
|
|
|
|
|
2014-03-09 15:33:26 +03:00
|
|
|
FIRST_NON_SPELL = 70, AFTER_LAST = 82
|
2013-02-09 01:42:46 +03:00
|
|
|
};
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
SpellID(ESpellID _num = NONE) : num(_num)
|
|
|
|
{}
|
|
|
|
|
2013-02-13 22:35:43 +03:00
|
|
|
//TODO: should this be const?
|
2013-02-11 02:24:57 +03:00
|
|
|
DLL_LINKAGE CSpell * toSpell() const;
|
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(SpellID, ESpellID)
|
|
|
|
|
|
|
|
ESpellID num;
|
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(SpellID, SpellID::ESpellID)
|
2015-01-30 08:39:36 +02:00
|
|
|
|
2014-11-12 10:03:55 +02:00
|
|
|
enum class ESpellSchool: ui8
|
|
|
|
{
|
|
|
|
AIR = 0,
|
|
|
|
FIRE = 1,
|
|
|
|
WATER = 2,
|
|
|
|
EARTH = 3
|
|
|
|
};
|
|
|
|
|
2011-12-14 00:35:28 +03:00
|
|
|
// Typedef declarations
|
2013-03-02 19:55:51 +03:00
|
|
|
typedef ui8 TFaction;
|
2012-09-23 21:01:04 +03:00
|
|
|
typedef si64 TExpType;
|
2011-12-14 00:35:28 +03:00
|
|
|
typedef std::pair<ui32, ui32> TDmgRange;
|
|
|
|
typedef si32 TBonusSubtype;
|
2012-09-23 21:01:04 +03:00
|
|
|
typedef si32 TQuantity;
|
2013-02-11 02:24:57 +03:00
|
|
|
|
2013-08-17 15:46:48 +03:00
|
|
|
typedef int TRmgTemplateZoneId;
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
#undef ID_LIKE_CLASS_COMMON
|
2015-11-22 06:16:20 +02:00
|
|
|
#undef ID_LIKE_OPERATORS
|
|
|
|
#undef ID_LIKE_OPERATORS_INTERNAL
|
2013-02-14 02:55:42 +03:00
|
|
|
#undef INSTID_LIKE_CLASS_COMMON
|
|
|
|
#undef OP_DECL_INT
|