1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

A sketch of new artifact system based on pointers.

This commit is contained in:
DjWarmonger
2010-10-01 16:54:12 +00:00
parent e481a4375b
commit 2866222280
3 changed files with 45 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ typedef boost::int32_t si32; //signed int 32 bits (4 bytes)
typedef boost::int16_t si16; //signed int 16 bits (2 bytes)
typedef boost::int8_t si8; //signed int 8 bits (1 byte)
typedef si64 expType;
typedef ui16 spelltype;
#include "int3.h"
#include <map>
#include <vector>

View File

@@ -52,6 +52,50 @@ public:
void getParents(TCNodes &out, const CBonusSystemNode *root = NULL) const;
};
class DLL_EXPORT IModableArt //artifact which can have different properties, such as scroll or banner
{
public:
virtual void Init() = 0;
};
class DLL_EXPORT CScroll : public CArtifact, public IModableArt // Spell Scroll
{
public:
spelltype spellid;
void Init(){};
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CArtifact&>(*this);
h & spellid;
}
};
class DLL_EXPORT CCustomizableArt : public CArtifact, public IModableArt // Warlord's Banner with multiple options
{
public:
ui8 mode;
void Init(){};
void SelectMode (int mod){};
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CArtifact&>(*this);
h & mode;
}
};
class DLL_EXPORT CCommanderArt : public CArtifact, public IModableArt // Growing with time
{
public:
ui32 level;
void Init(){};
void Upgrade(){level++;};
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CArtifact&>(*this);
h & level;
}
};
class DLL_EXPORT CArtHandler //handles artifacts
{
void giveArtBonus(int aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, ILimiter * limiter = NULL);

View File

@@ -16,7 +16,6 @@
* Full text of license available in license.txt file, in main folder
*
*/
typedef ui16 spelltype;
class DLL_EXPORT CSpell
{