2011-12-14 00:35:28 +03:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
2017-07-13 10:26:03 +02:00
|
|
|
#pragma once
|
2011-12-14 00:35:28 +03:00
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
#include "ConstTransitivePtr.h"
|
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
class Artifact;
|
|
|
|
class ArtifactService;
|
|
|
|
class Creature;
|
|
|
|
class CreatureService;
|
|
|
|
|
|
|
|
namespace spells
|
|
|
|
{
|
|
|
|
class Spell;
|
|
|
|
class Service;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CArtifact;
|
|
|
|
class CArtifactInstance;
|
|
|
|
class CCreature;
|
|
|
|
class CHero;
|
|
|
|
class CSpell;
|
|
|
|
class CSkill;
|
|
|
|
class CGameInfoCallback;
|
|
|
|
class CNonConstInfoCallback;
|
|
|
|
|
|
|
|
struct IdTag
|
|
|
|
{};
|
|
|
|
|
2011-12-14 00:35:28 +03:00
|
|
|
namespace GameConstants
|
|
|
|
{
|
2016-10-27 15:27:10 +02:00
|
|
|
DLL_LINKAGE extern const std::string VCMI_VERSION;
|
2011-12-14 00:35:28 +03:00
|
|
|
|
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;
|
2016-11-26 14:14:43 +02:00
|
|
|
const int SKILL_GOLD_COST = 2000;
|
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;
|
2021-07-28 17:54:32 +02:00
|
|
|
const int SKILL_PER_HERO = 8;
|
|
|
|
const ui32 HERO_HIGH_LEVEL = 10; // affects primary skill upgrade order
|
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 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
|
2016-11-13 12:38:42 +02:00
|
|
|
|
|
|
|
const int HERO_PORTRAIT_SHIFT = 30;// 2 special frames + some extra portraits
|
2018-01-05 19:21:07 +02:00
|
|
|
|
|
|
|
const std::array<int, 11> POSSIBLE_TURNTIME = {1, 2, 4, 6, 8, 10, 15, 20, 25, 30, 0};
|
2011-12-14 00:35:28 +03:00
|
|
|
}
|
|
|
|
|
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; \
|
|
|
|
} \
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
si32 getNum() const \
|
|
|
|
{ \
|
|
|
|
return static_cast<si32>(num); \
|
|
|
|
} \
|
2013-02-11 02:24:57 +03:00
|
|
|
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>
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
class BaseForID : public IdTag
|
2013-02-14 02:55:42 +03:00
|
|
|
{
|
|
|
|
protected:
|
2013-03-03 20:06:03 +03:00
|
|
|
NumericType num;
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
|
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;
|
|
|
|
}
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
|
|
|
|
//to make it more similar to IDLIKE
|
|
|
|
NumericType toEnum() const
|
|
|
|
{
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
2013-02-14 02:55:42 +03:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
class HeroClassID : public BaseForID<HeroClassID, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(HeroClassID, si32)
|
|
|
|
};
|
|
|
|
|
2013-05-19 01:30:48 +03:00
|
|
|
class HeroTypeID : public BaseForID<HeroTypeID, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(HeroTypeID, si32)
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
|
|
|
|
///json serialization helpers
|
|
|
|
static si32 decode(const std::string & identifier);
|
|
|
|
static std::string encode(const si32 index);
|
2013-05-19 01:30:48 +03:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2017-06-03 07:25:10 +02:00
|
|
|
DLL_LINKAGE static const PlayerColor SPECTATOR; //252
|
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)
|
2017-06-03 07:25:10 +02:00
|
|
|
DLL_LINKAGE bool isSpectator() const;
|
2013-04-20 14:34:01 +03:00
|
|
|
|
2016-09-16 04:45:00 +02:00
|
|
|
DLL_LINKAGE std::string getStr(bool L10n = false) const;
|
|
|
|
DLL_LINKAGE std::string getStrCap(bool L10n = false) const;
|
2016-09-15 17:22:54 +02:00
|
|
|
|
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
|
|
|
|
{
|
2021-01-14 00:02:13 +02:00
|
|
|
enum PrimarySkill { NONE = -1, ATTACK, DEFENSE, SPELL_POWER, KNOWLEDGE,
|
2013-02-04 15:32:53 +03:00
|
|
|
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 };
|
|
|
|
}
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
namespace ETownType//deprecated
|
2012-09-05 15:49:23 +03:00
|
|
|
{
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
class FactionID : public BaseForID<FactionID, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(FactionID, si32)
|
|
|
|
|
|
|
|
DLL_LINKAGE static const FactionID ANY;
|
|
|
|
DLL_LINKAGE static const FactionID CASTLE;
|
|
|
|
DLL_LINKAGE static const FactionID RAMPART;
|
|
|
|
DLL_LINKAGE static const FactionID TOWER;
|
|
|
|
DLL_LINKAGE static const FactionID INFERNO;
|
|
|
|
DLL_LINKAGE static const FactionID NECROPOLIS;
|
|
|
|
DLL_LINKAGE static const FactionID DUNGEON;
|
|
|
|
DLL_LINKAGE static const FactionID STRONGHOLD;
|
|
|
|
DLL_LINKAGE static const FactionID FORTRESS;
|
|
|
|
DLL_LINKAGE static const FactionID CONFLUX;
|
|
|
|
DLL_LINKAGE static const FactionID NEUTRAL;
|
|
|
|
|
|
|
|
///json serialization helpers
|
|
|
|
static si32 decode(const std::string & identifier);
|
|
|
|
static std::string encode(const si32 index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
{}
|
|
|
|
|
2020-10-07 14:12:32 +02:00
|
|
|
STRONG_INLINE
|
|
|
|
bool IsSpecialOrGrail() const
|
|
|
|
{
|
|
|
|
return num == SPECIAL_1 || num == SPECIAL_2 || num == SPECIAL_3 || num == SPECIAL_4 || num == GRAIL;
|
|
|
|
}
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
ID_LIKE_CLASS_COMMON(BuildingID, EBuildingID)
|
|
|
|
|
|
|
|
EBuildingID num;
|
|
|
|
};
|
|
|
|
|
2020-10-07 14:12:32 +02:00
|
|
|
ID_LIKE_OPERATORS(BuildingID, BuildingID::EBuildingID)
|
2020-10-02 23:55:46 +02:00
|
|
|
|
|
|
|
namespace BuildingSubID
|
|
|
|
{
|
|
|
|
enum EBuildingSubID
|
|
|
|
{
|
|
|
|
DEFAULT = -50,
|
|
|
|
NONE = -1,
|
|
|
|
STABLES,
|
|
|
|
BROTHERHOOD_OF_SWORD,
|
|
|
|
CASTLE_GATE,
|
|
|
|
CREATURE_TRANSFORMER,
|
|
|
|
MYSTIC_POND,
|
|
|
|
FOUNTAIN_OF_FORTUNE,
|
|
|
|
ARTIFACT_MERCHANT,
|
|
|
|
LOOKOUT_TOWER,
|
|
|
|
LIBRARY,
|
|
|
|
MANA_VORTEX,
|
|
|
|
PORTAL_OF_SUMMONING,
|
|
|
|
ESCAPE_TUNNEL,
|
|
|
|
FREELANCERS_GUILD,
|
|
|
|
BALLISTA_YARD,
|
2020-10-19 21:38:06 +02:00
|
|
|
ATTACK_VISITING_BONUS,
|
2020-10-02 23:55:46 +02:00
|
|
|
MAGIC_UNIVERSITY,
|
|
|
|
SPELL_POWER_GARRISON_BONUS,
|
|
|
|
ATTACK_GARRISON_BONUS,
|
2020-10-19 21:38:06 +02:00
|
|
|
DEFENSE_GARRISON_BONUS,
|
|
|
|
DEFENSE_VISITING_BONUS,
|
|
|
|
SPELL_POWER_VISITING_BONUS,
|
|
|
|
KNOWLEDGE_VISITING_BONUS,
|
|
|
|
EXPERIENCE_VISITING_BONUS,
|
|
|
|
LIGHTHOUSE,
|
2021-01-14 00:02:13 +02:00
|
|
|
TREASURY,
|
|
|
|
CUSTOM_VISITING_BONUS
|
2020-10-02 23:55:46 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-10-07 14:12:32 +02:00
|
|
|
namespace MappedKeys
|
|
|
|
{
|
|
|
|
|
|
|
|
static const std::map<std::string, BuildingID> BUILDING_NAMES_TO_TYPES =
|
|
|
|
{
|
|
|
|
{ "special1", BuildingID::SPECIAL_1 },
|
|
|
|
{ "special2", BuildingID::SPECIAL_2 },
|
|
|
|
{ "special3", BuildingID::SPECIAL_3 },
|
|
|
|
{ "special4", BuildingID::SPECIAL_4 },
|
|
|
|
{ "grail", BuildingID::GRAIL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const std::map<BuildingID, std::string> BUILDING_TYPES_TO_NAMES =
|
|
|
|
{
|
|
|
|
{ BuildingID::SPECIAL_1, "special1", },
|
|
|
|
{ BuildingID::SPECIAL_2, "special2" },
|
|
|
|
{ BuildingID::SPECIAL_3, "special3" },
|
|
|
|
{ BuildingID::SPECIAL_4, "special4" },
|
|
|
|
{ BuildingID::GRAIL, "grail"}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const std::map<std::string, BuildingSubID::EBuildingSubID> SPECIAL_BUILDINGS =
|
|
|
|
{
|
|
|
|
{ "mysticPond", BuildingSubID::MYSTIC_POND },
|
|
|
|
{ "artifactMerchant", BuildingSubID::ARTIFACT_MERCHANT },
|
|
|
|
{ "freelancersGuild", BuildingSubID::FREELANCERS_GUILD },
|
|
|
|
{ "magicUniversity", BuildingSubID::MAGIC_UNIVERSITY },
|
|
|
|
{ "castleGate", BuildingSubID::CASTLE_GATE },
|
|
|
|
{ "creatureTransformer", BuildingSubID::CREATURE_TRANSFORMER },//only skeleton transformer yet
|
|
|
|
{ "portalOfSummoning", BuildingSubID::PORTAL_OF_SUMMONING },
|
|
|
|
{ "ballistaYard", BuildingSubID::BALLISTA_YARD },
|
|
|
|
{ "stables", BuildingSubID::STABLES },
|
|
|
|
{ "manaVortex", BuildingSubID::MANA_VORTEX },
|
|
|
|
{ "lookoutTower", BuildingSubID::LOOKOUT_TOWER },
|
|
|
|
{ "library", BuildingSubID::LIBRARY },
|
|
|
|
{ "brotherhoodOfSword", BuildingSubID::BROTHERHOOD_OF_SWORD },//morale garrison bonus
|
|
|
|
{ "fountainOfFortune", BuildingSubID::FOUNTAIN_OF_FORTUNE },//luck garrison bonus
|
|
|
|
{ "spellPowerGarrisonBonus", BuildingSubID::SPELL_POWER_GARRISON_BONUS },//such as 'stormclouds', but this name is not ok for good towns
|
|
|
|
{ "attackGarrisonBonus", BuildingSubID::ATTACK_GARRISON_BONUS },
|
|
|
|
{ "defenseGarrisonBonus", BuildingSubID::DEFENSE_GARRISON_BONUS },
|
2020-10-19 21:38:06 +02:00
|
|
|
{ "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL },
|
|
|
|
{ "attackVisitingBonus", BuildingSubID::ATTACK_VISITING_BONUS },
|
|
|
|
{ "defenceVisitingBonus", BuildingSubID::DEFENSE_VISITING_BONUS },
|
|
|
|
{ "spellPowerVisitingBonus", BuildingSubID::SPELL_POWER_VISITING_BONUS },
|
|
|
|
{ "knowledgeVisitingBonus", BuildingSubID::KNOWLEDGE_VISITING_BONUS },
|
|
|
|
{ "experienceVisitingBonus", BuildingSubID::EXPERIENCE_VISITING_BONUS },
|
|
|
|
{ "lighthouse", BuildingSubID::LIGHTHOUSE },
|
|
|
|
{ "treasury", BuildingSubID::TREASURY }
|
2020-10-07 14:12:32 +02:00
|
|
|
};
|
|
|
|
}
|
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
|
|
|
|
{
|
2017-07-20 06:08:49 +02:00
|
|
|
OK, NO_HERO_TO_CAST_SPELL, CASTS_PER_TURN_LIMIT, NO_SPELLBOOK,
|
2011-12-14 00:35:28 +03:00
|
|
|
HERO_DOESNT_KNOW_SPELL, NOT_ENOUGH_MANA, ADVMAP_SPELL_INSTEAD_OF_BATTLE_SPELL,
|
2017-07-20 06:08:49 +02:00
|
|
|
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
|
|
|
|
INVALID
|
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
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2022-09-19 16:13:58 +02:00
|
|
|
namespace Terrain
|
|
|
|
{
|
2022-09-21 11:34:23 +02:00
|
|
|
enum ETerrain : si8
|
2022-09-19 16:13:58 +02:00
|
|
|
{
|
2022-09-21 11:34:23 +02:00
|
|
|
NATIVE_TERRAIN = -4,
|
2022-09-19 16:13:58 +02:00
|
|
|
ANY_TERRAIN = -3,
|
|
|
|
WRONG = -2,
|
|
|
|
BORDER = -1,
|
|
|
|
FIRST_REGULAR_TERRAIN = 0,
|
|
|
|
DIRT = 0,
|
|
|
|
SAND,
|
|
|
|
GRASS,
|
|
|
|
SNOW,
|
|
|
|
SWAMP,
|
|
|
|
ROUGH,
|
|
|
|
SUBTERRANEAN,
|
|
|
|
LAVA,
|
|
|
|
WATER,
|
|
|
|
ROCK,
|
|
|
|
ORIGINAL_TERRAIN_COUNT
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-09-23 16:24:01 +02:00
|
|
|
namespace Road
|
|
|
|
{
|
|
|
|
enum ERoad : ui8
|
|
|
|
{
|
|
|
|
NO_ROAD = 0,
|
2022-09-26 10:20:39 +02:00
|
|
|
FIRST_REGULAR_ROAD = 1,
|
2022-09-23 16:24:01 +02:00
|
|
|
DIRT_ROAD = 1,
|
|
|
|
GRAVEL_ROAD = 2,
|
|
|
|
COBBLESTONE_ROAD = 3,
|
2022-09-23 18:57:16 +02:00
|
|
|
ORIGINAL_ROAD_COUNT //+1
|
2022-09-23 16:24:01 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace River
|
|
|
|
{
|
|
|
|
enum ERiver : ui8
|
|
|
|
{
|
|
|
|
NO_RIVER = 0,
|
2022-09-26 09:51:36 +02:00
|
|
|
FIRST_REGULAR_RIVER = 1,
|
2022-09-23 16:24:01 +02:00
|
|
|
WATER_RIVER = 1,
|
|
|
|
ICY_RIVER = 2,
|
|
|
|
MUD_RIVER = 3,
|
|
|
|
LAVA_RIVER = 4,
|
2022-09-23 18:57:16 +02:00
|
|
|
ORIGINAL_RIVER_COUNT //+1
|
2022-09-23 16:24:01 +02: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-02 11:29:57 +03:00
|
|
|
namespace Date
|
|
|
|
{
|
|
|
|
enum EDateType
|
|
|
|
{
|
|
|
|
DAY = 0,
|
|
|
|
DAY_OF_WEEK = 1,
|
|
|
|
WEEK = 2,
|
|
|
|
MONTH = 3,
|
|
|
|
DAY_OF_MONTH
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
enum class EActionType : int32_t
|
2013-02-04 00:05:44 +03:00
|
|
|
{
|
2017-07-20 06:08:49 +02:00
|
|
|
CANCEL = -3,
|
|
|
|
END_TACTIC_PHASE = -2,
|
|
|
|
INVALID = -1,
|
|
|
|
NO_ACTION = 0,
|
|
|
|
HERO_SPELL,
|
2022-12-09 13:10:35 +02:00
|
|
|
WALK,
|
|
|
|
DEFEND,
|
2017-07-20 06:08:49 +02:00
|
|
|
RETREAT,
|
|
|
|
SURRENDER,
|
|
|
|
WALK_AND_ATTACK,
|
|
|
|
SHOOT,
|
|
|
|
WAIT,
|
|
|
|
CATAPULT,
|
|
|
|
MONSTER_SPELL,
|
|
|
|
BAD_MORALE,
|
|
|
|
STACK_HEAL,
|
|
|
|
};
|
2013-02-04 00:05:44 +03:00
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
DLL_LINKAGE std::ostream & operator<<(std::ostream & os, const EActionType actionType);
|
2013-11-09 19:25:20 +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-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
|
|
|
{
|
2022-12-28 21:58:32 +02:00
|
|
|
TRANSITION_POS = -3,
|
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)
|
|
|
|
{}
|
|
|
|
|
2016-10-02 14:22:55 +02:00
|
|
|
DLL_LINKAGE const CArtifact * toArtifact() const;
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
DLL_LINKAGE const Artifact * toArtifact(const ArtifactService * service) const;
|
2013-02-11 02:24:57 +03:00
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
///json serialization helpers
|
|
|
|
static si32 decode(const std::string & identifier);
|
|
|
|
static std::string encode(const si32 index);
|
|
|
|
|
2013-02-11 02:24:57 +03:00
|
|
|
ID_LIKE_CLASS_COMMON(ArtifactID, EArtifactID)
|
|
|
|
|
|
|
|
EArtifactID num;
|
2022-11-30 17:57:39 +02:00
|
|
|
|
|
|
|
struct hash
|
|
|
|
{
|
|
|
|
size_t operator()(const ArtifactID & aid) const
|
|
|
|
{
|
|
|
|
return std::hash<int>()(aid.num);
|
|
|
|
}
|
|
|
|
};
|
2013-02-11 02:24:57 +03:00
|
|
|
};
|
|
|
|
|
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,
|
2021-01-17 14:02:58 +02:00
|
|
|
ARCHER = 2,
|
2013-02-07 20:34:50 +03:00
|
|
|
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)
|
|
|
|
{}
|
|
|
|
|
2016-10-02 14:22:55 +02:00
|
|
|
DLL_LINKAGE const CCreature * toCreature() const;
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
DLL_LINKAGE const Creature * toCreature(const CreatureService * creatures) const;
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(CreatureID, ECreatureID)
|
|
|
|
|
|
|
|
ECreatureID num;
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
///json serialization helpers
|
|
|
|
static si32 decode(const std::string & identifier);
|
|
|
|
static std::string encode(const si32 index);
|
2013-02-11 02:24:57 +03:00
|
|
|
};
|
|
|
|
|
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)
|
|
|
|
{}
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
DLL_LINKAGE const CSpell * toSpell() const; //deprecated
|
|
|
|
DLL_LINKAGE const spells::Spell * toSpell(const spells::Service * service) const;
|
2013-02-11 02:24:57 +03:00
|
|
|
|
|
|
|
ID_LIKE_CLASS_COMMON(SpellID, ESpellID)
|
|
|
|
|
|
|
|
ESpellID num;
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
///json serialization helpers
|
|
|
|
static si32 decode(const std::string & identifier);
|
|
|
|
static std::string encode(const si32 index);
|
2013-02-11 02:24:57 +03:00
|
|
|
};
|
|
|
|
|
2015-11-22 06:16:20 +02:00
|
|
|
ID_LIKE_OPERATORS(SpellID, SpellID::ESpellID)
|
2015-01-30 08:39:36 +02:00
|
|
|
|
2022-06-28 10:05:30 +02:00
|
|
|
class BattleFieldInfo;
|
|
|
|
class BattleField : public BaseForID<BattleField, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(BattleField, si32)
|
|
|
|
|
|
|
|
DLL_LINKAGE static const BattleField NONE;
|
|
|
|
|
|
|
|
DLL_LINKAGE friend bool operator==(const BattleField & l, const BattleField & r);
|
|
|
|
DLL_LINKAGE friend bool operator!=(const BattleField & l, const BattleField & r);
|
|
|
|
DLL_LINKAGE friend bool operator<(const BattleField & l, const BattleField & r);
|
|
|
|
|
|
|
|
DLL_LINKAGE operator std::string() const;
|
|
|
|
DLL_LINKAGE const BattleFieldInfo * getInfo() const;
|
|
|
|
|
|
|
|
DLL_LINKAGE static BattleField fromString(std::string identifier);
|
|
|
|
};
|
2022-09-15 10:06:54 +02:00
|
|
|
|
|
|
|
class ObstacleInfo;
|
|
|
|
class Obstacle : public BaseForID<Obstacle, si32>
|
|
|
|
{
|
|
|
|
INSTID_LIKE_CLASS_COMMON(Obstacle, si32)
|
|
|
|
|
|
|
|
DLL_LINKAGE const ObstacleInfo * getInfo() const;
|
|
|
|
DLL_LINKAGE operator std::string() const;
|
|
|
|
DLL_LINKAGE static Obstacle fromString(std::string identifier);
|
|
|
|
};
|
2022-06-28 10:05:30 +02:00
|
|
|
|
2014-11-12 10:03:55 +02:00
|
|
|
enum class ESpellSchool: ui8
|
|
|
|
{
|
|
|
|
AIR = 0,
|
|
|
|
FIRE = 1,
|
|
|
|
WATER = 2,
|
|
|
|
EARTH = 3
|
|
|
|
};
|
|
|
|
|
2016-11-13 12:38:42 +02:00
|
|
|
enum class EMetaclass: ui8
|
|
|
|
{
|
|
|
|
INVALID = 0,
|
|
|
|
ARTIFACT,
|
|
|
|
CREATURE,
|
|
|
|
FACTION,
|
|
|
|
EXPERIENCE,
|
|
|
|
HERO,
|
|
|
|
HEROCLASS,
|
|
|
|
LUCK,
|
|
|
|
MANA,
|
|
|
|
MORALE,
|
|
|
|
MOVEMENT,
|
|
|
|
OBJECT,
|
|
|
|
PRIMARY_SKILL,
|
|
|
|
SECONDARY_SKILL,
|
|
|
|
SPELL,
|
|
|
|
RESOURCE
|
|
|
|
};
|
|
|
|
|
2017-07-04 13:24:46 +02:00
|
|
|
enum class EHealLevel: ui8
|
|
|
|
{
|
|
|
|
HEAL,
|
|
|
|
RESURRECT,
|
|
|
|
OVERHEAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class EHealPower : ui8
|
|
|
|
{
|
|
|
|
ONE_BATTLE,
|
|
|
|
PERMANENT
|
|
|
|
};
|
|
|
|
|
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;
|
2017-07-20 06:08:49 +02:00
|
|
|
typedef std::pair<si64, si64> TDmgRange;
|
2011-12-14 00:35:28 +03:00
|
|
|
typedef si32 TBonusSubtype;
|
2012-09-23 21:01:04 +03:00
|
|
|
typedef si32 TQuantity;
|
2022-09-29 11:44:46 +02:00
|
|
|
typedef si8 TerrainId;
|
|
|
|
typedef si8 RoadId;
|
|
|
|
typedef si8 RiverId;
|
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
|
2022-07-26 15:07:42 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|